Closed Bug 1230913 Opened 10 years ago Closed 10 years ago

[Static Analysis][Dereference before null check] In function TextureClient::CreateWithBufferSize from TextureClient.cpp

Categories

(Core :: Graphics: Layers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla46
Tracking Status
firefox45 --- affected
firefox46 --- fixed

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1338036)

Attachments

(1 file, 1 obsolete file)

The Static Analysis tool Coverity added that pointer aAllocator is dereferenced before null check, that could resul to a null poinder dereference.
Summary: [Static Analysis][Dereference before null check] In function 46TextureClient::CreateWithBufferSize from TextureClient.cpp → [Static Analysis][Dereference before null check] In function TextureClient::CreateWithBufferSize from TextureClient.cpp
Attached patch Bug 1230913.diff (obsolete) — — Splinter Review
Hello Robert, Can you please take a look other this patch? THX
Attachment #8696444 - Flags: review?(roc)
Comment on attachment 8696444 [details] [diff] [review] Bug 1230913.diff Review of attachment 8696444 [details] [diff] [review]: ----------------------------------------------------------------- r+ with that change ::: gfx/layers/client/TextureClient.cpp @@ +844,5 @@ > size_t aSize, > TextureFlags aTextureFlags) > { > + // also test the validity of aAllocator > + MOZ_ASSERT(aAllocator ? aAllocator->IPCOpen() : false); You should never use the ?: operator with a boolean constant. Here you can write MOZ_ASSERT(aAllocator && aAllocator->IPCOpen());
Attachment #8696444 - Flags: review?(roc) → review+
Attached patch Bug 1230913.diff — — Splinter Review
Thx for seeing that Robert
Attachment #8696444 - Attachment is obsolete: true
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: