diff options
author | Cong Ding <dinggnu@gmail.com> | 2013-01-25 17:48:59 -0600 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2013-01-25 17:48:59 -0600 |
commit | 1ec3911dbd19076bcdfe5540096ff67f91a6ec02 (patch) | |
tree | 95aac4248cb875f7e3f99b1373fdea5ada061298 /include | |
parent | c04306471ad93f1daf60771a0373316d4c3494ae (diff) | |
download | linux-stable-1ec3911dbd19076bcdfe5540096ff67f91a6ec02.tar.gz linux-stable-1ec3911dbd19076bcdfe5540096ff67f91a6ec02.tar.bz2 linux-stable-1ec3911dbd19076bcdfe5540096ff67f91a6ec02.zip |
libceph: fix undefined behavior when using snprintf()
The variable "str" is used as both the source and destination in
function snprintf(), which is undefined behavior based on C11. The
original description in C11 is:
"If copying takes place between objects that
overlap, the behavior is undefined."
And, the function of ceph_osdmap_state_str() is to return the osdmap
state, so it should return "doesn't exist" when all the conditions
are not satisfied. I fix it in this patch.
[elder@inktank.com: shortened the commit message]
Signed-off-by: Cong Ding <dinggnu@gmail.com>
Reviewed-by: Alex Elder <elder@inktank.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions