projects
/
ffsb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da1232b
)
parser: fix strncpy bug
author
Xiubo Li
<xiubli@redhat.com>
Thu, 15 Apr 2021 03:55:42 +0000
(11:55 +0800)
committer
Xiubo Li
<xiubli@redhat.com>
Thu, 15 Apr 2021 05:24:10 +0000
(13:24 +0800)
Fixes: http://tracker.ceph.com/issues/24579
Signed-off-by: Yan, Zheng <zyan@redhat.com>
parser.c
patch
|
blob
|
history
diff --git
a/parser.c
b/parser.c
index 8f3f08638f963576344ab85626c0bd511d51a322..06547817e6aae43435d8fef9f1d8a95a76a18058 100644
(file)
--- a/
parser.c
+++ b/
parser.c
@@
-203,7
+203,7
@@
static char *get_optstr(char *buf, char string[])
len = strnlen(string, BUFSIZE);
sprintf(search_str, "%s=%%%ds\\n", string, BUFSIZE - len-1);
if (1 == sscanf(line, search_str, &temp)) {
- len = strnlen(temp, 409
6)
;
+ len = strnlen(temp, 409
5) + 1
;
ret_buf = malloc(len);
strncpy(ret_buf, temp, len);
return ret_buf;