diff options
author | Ido Yariv <ido@wizery.com> | 2012-05-28 21:33:05 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-05-28 23:08:22 +0300 |
commit | a3671b9d0e7b9df21a1539d3e952b099900b8d10 (patch) | |
tree | 603a7f478409c7750031ddd59c7ec774a8a7e139 /bootstrap-configure | |
parent | e1942bc1bef0575da5787127854fa7e56acef0a7 (diff) | |
download | bluez-a3671b9d0e7b9df21a1539d3e952b099900b8d10.tar.gz |
attrib-server: Allow zero length attribute update
attrib_db_update always fails when g_try_realloc returns NULL, not
taking into account that the length passed to g_try_realloc could be
zero. In this case, g_try_realloc frees the currently allocated memory
and returns NULL.
As a result, not only will attrib_db_update fail needlessly, a
use-after-free could occur as the attribute's length will still hold the
length of the freed buffer.
Fix this by only returning an error if the length is non-zero.
Diffstat (limited to 'bootstrap-configure')
0 files changed, 0 insertions, 0 deletions