Bug 38570

Summary: DBusString has a concept of "maximum length" which is documented to be broken
Product: dbus Reporter: Simon McVittie <smcv>
Component: coreAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: John (J5) Palmieri <johnp>
Severity: minor    
Priority: medium CC: hp, will
Version: 1.5Keywords: patch
Hardware: Other   
OS: All   
URL: http://cgit.freedesktop.org/~smcv/dbus/log/?h=no-max-len-38570
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 36164    
Attachments: [PATCH 1/3] Split DBUS_GENERIC_STRING_PREAMBLE into sensible lines
[PATCH 2/3] Remove unused _dbus_string_copy_data_len, _dbus_string_steal_data_len
[PATCH 3/3] Remove maximum length field from DBusString

Description Simon McVittie 2011-06-22 06:59:50 UTC
-/* The max length thing is sort of a historical artifact
- * from a feature that turned out to be dumb; perhaps
- * we should purge it entirely.

Less code, fewer bugs!
Comment 1 Simon McVittie 2011-06-22 07:00:58 UTC
Created attachment 48285 [details] [review]
[PATCH 1/3] Split DBUS_GENERIC_STRING_PREAMBLE into sensible lines
Comment 2 Simon McVittie 2011-06-22 07:01:23 UTC
Created attachment 48286 [details] [review]
[PATCH 2/3] Remove unused _dbus_string_copy_data_len, _dbus_string_steal_data_len

They're only compiled when building tests.
Comment 3 Simon McVittie 2011-06-22 07:01:45 UTC
Created attachment 48287 [details] [review]
[PATCH 3/3] Remove maximum length field from DBusString

The source code says it's "a historical artifact from a feature that
turned out to be dumb". Respond accordingly!

This reduces sizeof (DBusString) by 20% on ILP32 architectures, which
can't hurt. (No reduction on LP64 architectures that align pointers
naturally, unfortunately.)
Comment 4 Will Thompson 2011-06-22 09:52:49 UTC
Review of attachment 48285 [details] [review]:

Looks fine
Comment 5 Will Thompson 2011-06-22 09:54:23 UTC
Review of attachment 48286 [details] [review]:

Seems reasonable.
Comment 6 Will Thompson 2011-06-22 10:19:55 UTC
Review of attachment 48287 [details] [review]:

This looks about right to me! I love the idea of a MAX_MAX_LENGTH.
Comment 7 Simon McVittie 2011-06-22 11:35:21 UTC
Thanks, fixed in master for 1.5.6.

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.