diff options
author | Günther Deschner <gd@samba.org> | 2017-07-28 13:38:16 +0200 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-08-01 13:14:03 +0000 |
commit | ab4ffdac9dec1867f2d9b33242179cf2b347319d (patch) | |
tree | 66f0af0e1c9888ab1026f69e68009ca078ddc1ad /events | |
parent | e5db980504bc4ace037ea806ad89a1ca897150d5 (diff) |
md-cache: avoid checking the xattr value buffer with string functions.
xattrs may very well contain binary, non-text data with leading 0
values. Using strcmp for checking empty values is not the appropriate
thing to do: In the best case, it might treat a binary xattr value
starting with 0 from being cached (and hence also from being reported
back with xattr). In the worst case, we might read beyond the end
of a data blob that does contain any zero byte.
We fix this by checking the length of the data blob and checking
the first byte against 0 if the length is one.
Signed-off-by: Guenther Deschner <gd@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Change-Id: If723c465a630b8a37b6be58782a2724df7ac6b11
BUG: 1476324
Reviewed-on: https://review.gluster.org/17910
Reviewed-by: Michael Adam <obnox@samba.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Poornima G <pgurusid@redhat.com>
Tested-by: Poornima G <pgurusid@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'events')
0 files changed, 0 insertions, 0 deletions