git.samba.org
/
samba.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix bug 6546: Avoid accessing buf[-1] if NUL byte comes from fgets
[samba.git]
/
source4
/
torture
/
nbench
/
nbench.c
diff --git
a/source4/torture/nbench/nbench.c
b/source4/torture/nbench/nbench.c
index 5a4037f906d1d73dba685ae5b9922ca0ab2100de..05c889d1b7d34587bc91c1bbe3f0d42e29b6b10e 100644
(file)
--- a/
source4/torture/nbench/nbench.c
+++ b/
source4/torture/nbench/nbench.c
@@
-95,7
+95,9
@@
again:
nbench_line_count++;
- line[strlen(line)-1] = 0;
+ if ((strlen(line) > 0) && line[strlen(line)-1] == '\n') {
+ line[strlen(line)-1] = 0;
+ }
all_string_sub(line,"client1", cname, sizeof(line));