mirror of
https://github.com/ceph/ceph
synced 2025-01-05 02:32:59 +00:00
843cddaaf8
Signed-off-by: Yan, Zheng <zyan@redhat.com> Fixes: http://tracker.ceph.com/issues/24579
13 lines
479 B
Diff
13 lines
479 B
Diff
diff -urp 1/parser.c 2/parser.c
|
|
--- 1/parser.c 2008-10-28 04:17:05.000000000 +0800
|
|
+++ 2/parser.c 2018-06-26 20:25:59.000000000 +0800
|
|
@@ -203,7 +203,7 @@ static char *get_optstr(char *buf, char
|
|
len = strnlen(string, BUFSIZE);
|
|
sprintf(search_str, "%s=%%%ds\\n", string, BUFSIZE - len-1);
|
|
if (1 == sscanf(line, search_str, &temp)) {
|
|
- len = strnlen(temp, 4096);
|
|
+ len = strnlen(temp, 4095) + 1;
|
|
ret_buf = malloc(len);
|
|
strncpy(ret_buf, temp, len);
|
|
return ret_buf;
|