Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip-librados-xattr: fix 13944, springing from "malloc(0) can return NULL on some platforms" #6779

Merged
merged 2 commits into from Dec 4, 2015

Conversation

dmick
Copy link
Member

@dmick dmick commented Dec 2, 2015

No description provided.

If an xattr is 0 length, don't try to malloc a buffer for the value;
leave it NULL.  (Linux doesn't promise malloc(0) returns a pointer,
and other implementations, like AIX, definitely return NULL.)

Usage changes are in following commits.

Fixes: #13944
Signed-off-by: Dan Mick <dan.mick@redhat.com>
Prior commit changes rados{striper}_getxattrs_next to be able to return
NULL in the 'val' param.  Handle that.

Fixes: #13944
Signed-off-by: Dan Mick <dan.mick@redhat.com>
liewegas added a commit that referenced this pull request Dec 4, 2015
librados: avoid malloc(0) (which can return NULL on some platforms)

Reviewed-by: Sage Weil <sage@redhat.com>
@liewegas liewegas merged commit 8d5e05a into master Dec 4, 2015
@dmick dmick deleted the wip-librados-xattr branch December 4, 2015 22:06
@ghost ghost added the core label Feb 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants