Commit 8eb29fda authored by Chengwei Yang's avatar Chengwei Yang Committed by Simon McVittie
Browse files

DBusString: fix may crash if try to free an uninitialized str

If the str will be freed hasn't been initialized by _dbus_string_init
correctly, _dbus_string_free may crash due to trying to free an
undefined memory.


Signed-off-by: default avatarChengwei Yang <>
Reviewed-by: default avatarSimon McVittie <>
parent ba0f90c1
......@@ -246,6 +246,14 @@ _dbus_string_free (DBusString *str)
if (real->constant)
/* so it's safe if @p str returned by a failed
* _dbus_string_init call
* Bug:
if (real->str == NULL)
dbus_free (real->str - real->align_offset);
real->invalid = TRUE;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment