Bug 69329 - Incorrect sizeof leads to allocation of more memory than needed for dbus-monitor filters
Summary: Incorrect sizeof leads to allocation of more memory than needed for dbus-moni...
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: All All
: low minor
Assignee: Havoc Pennington
QA Contact:
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2013-09-13 17:13 UTC by Sviatoslav Chagaev
Modified: 2013-09-16 15:27 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch for 1.6 (1.02 KB, patch)
2013-09-13 17:14 UTC, Sviatoslav Chagaev
Details | Splinter Review
Patch for 1.7 (1.02 KB, patch)
2013-09-13 17:14 UTC, Sviatoslav Chagaev
Details | Splinter Review

Description Sviatoslav Chagaev 2013-09-13 17:13:13 UTC

    
Comment 1 Sviatoslav Chagaev 2013-09-13 17:14:01 UTC
Created attachment 85781 [details] [review]
Patch for 1.6
Comment 2 Sviatoslav Chagaev 2013-09-13 17:14:26 UTC
Created attachment 85782 [details] [review]
Patch for 1.7
Comment 3 Simon McVittie 2013-09-16 11:44:08 UTC
Your patch is technically correct, but it should actually just be filter_len, because sizeof(char) is 1 by definition (sizeof(x) is the size of x, in chars) so there's no point in explicitly saying it. I've applied that to master.

Allocating 4 or 8 times as much memory as intended is harmless here, so I'm going to apply this to 1.7 only (1.6 is a minimally-changed stable-branch, with changes only where they fix a real bug).
Comment 4 Sviatoslav Chagaev 2013-09-16 15:27:29 UTC
(In reply to comment #3)
> Your patch is technically correct, but it should actually just be
> filter_len, because sizeof(char) is 1 by definition (sizeof(x) is the size
> of x, in chars) so there's no point in explicitly saying it. I've applied
> that to master.
> 
> Allocating 4 or 8 times as much memory as intended is harmless here, so I'm
> going to apply this to 1.7 only (1.6 is a minimally-changed stable-branch,
> with changes only where they fix a real bug).

Agreed, thanks!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.