Summary: | Incorrect sizeof leads to allocation of more memory than needed for dbus-monitor filters | ||
---|---|---|---|
Product: | dbus | Reporter: | Sviatoslav Chagaev <sviatoslav.chagaev> |
Component: | core | Assignee: | Havoc Pennington <hp> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | minor | ||
Priority: | low | Keywords: | patch |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Patch for 1.6
Patch for 1.7 |
Description
Sviatoslav Chagaev
2013-09-13 17:13:13 UTC
Created attachment 85781 [details] [review] Patch for 1.6 Created attachment 85782 [details] [review] Patch for 1.7 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). (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.