[patch] NUL in strings

Havoc Pennington hp at redhat.com
Mon May 21 07:59:49 PDT 2007


Simon McVittie wrote:
> My understanding is that NULs are not allowed in STRING (and that it's
> terminated with a NUL, but that's not semantically part of the data). IMO the
> specification could be interpreted either way, but libdbus doesn't appear to
> support NUL-safe strings:
> * dbus_message_iter_append_basic() stops appending at NUL
> * dbus_message_iter_get_basic() doesn't indicate the length
> Havoc/other designers, did you intend the STRING type to be NUL-safe?

No, it is certainly not allowed. Your patch looks good to be sure that's 

STRING is a human-readable string. Humans don't read nul ;-)


More information about the dbus mailing list