Parent: e1942bc1bef0575da5787127854fa7e56acef0a7
Author: Ido Yariv <ido@wizery.com>
Committer: Johan Hedberg <johan.hedberg@intel.com>
Date: 2012-05-28 23:08:22
Tree: 603a7f478409c7750031ddd59c7ec774a8a7e139
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
| M | src/attrib-server.c | | | 2 | +- |
1 files changed, 1 insertions(+), 1 deletions(-)