diff options
author | Anand Avati <avati@gluster.com> | 2011-05-20 16:56:29 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-07-29 01:28:37 -0700 |
commit | b221477eb60b22f2cbe994568f76f35b78369e24 (patch) | |
tree | e43f4b3b40387848457b774c94456440251f5381 /xlators/mount | |
parent | 1c1171c70869738bb7a368b86d1f6cab8467a3f6 (diff) |
quick-read: Fix dirname(3) usage
glibc dirname() modify the string it is given and returns it.
glusterfs takes this behavior for granted, and assume that if it
gives a malloc'ed string to dirname(), then it can free()) the
return value.
Here is what SUSv2 says:
http://opengroup.org/onlinepubs/007908799/xsh/dirname.html
"The dirname() function may modify the string pointed to by path,
and may return a pointer to static storage"
At least NetBSD returns a static storage. glusterfs will return it to
a calling function that has the responsability to free it, causing
a SIGSEGV.
Thanks to: Emmanuel Dreyfus <manu@netbsd.org>
Change-Id: I8b1b946a005ee487b4b9fb23c0f85a41facfe7c4
BUG: 2923
Reviewed-on: http://review.gluster.com/52
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'xlators/mount')
0 files changed, 0 insertions, 0 deletions