git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e4123f
)
the buffer must be greater then src string len otherwise bad things happen!
author
Simo Sorce
<idra@samba.org>
Fri, 19 Mar 2004 11:27:14 +0000
(11:27 +0000)
committer
Simo Sorce
<idra@samba.org>
Fri, 19 Mar 2004 11:27:14 +0000
(11:27 +0000)
source/lib/replace.c
patch
|
blob
|
history
diff --git
a/source/lib/replace.c
b/source/lib/replace.c
index cd48b8d160fe4f7f249694492c62afb886351c1f..fe1cfc04eb11c2edd4487782277de60b117fd15a 100644
(file)
--- a/
source/lib/replace.c
+++ b/
source/lib/replace.c
@@
-65,6
+65,9
@@
ftruncate for operating systems that don't have it
size_t len2 = strlen(s);
size_t ret = len1 + len2;
+ if (len1 >= bufsize) {
+ return 0;
+ }
if (len1+len2 >= bufsize) {
len2 = bufsize - (len1+1);
}