summaryrefslogtreecommitdiffstats
path: root/source/lib/util_str.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-07-18 22:55:48 +0000
committerGerald Carter <jerry@samba.org>2002-07-18 22:55:48 +0000
commita5aad760061e21635319a9b5628990cf59b827ed (patch)
tree61558520bbc368e8bb0b5d003313562e8153dcaa /source/lib/util_str.c
parente3b3c148208792ac2ccbfd468ad580b1264f9876 (diff)
downloadsamba-a5aad760061e21635319a9b5628990cf59b827ed.tar.gz
samba-a5aad760061e21635319a9b5628990cf59b827ed.tar.xz
samba-a5aad760061e21635319a9b5628990cf59b827ed.zip
The previous code would not allow things like string_sub(str, "\\", "/", 0).
It complained about an overflow of 0 bytes. Jeremy please check since you modified this last.
Diffstat (limited to 'source/lib/util_str.c')
-rw-r--r--source/lib/util_str.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/lib/util_str.c b/source/lib/util_str.c
index 88a72f15360..7da4358e661 100644
--- a/source/lib/util_str.c
+++ b/source/lib/util_str.c
@@ -670,7 +670,7 @@ void string_sub(char *s,const char *pattern, const char *insert, size_t len)
len = ls;
while (lp <= ls && (p = strstr(s,pattern))) {
- if (ls + (li-lp) >= len) {
+ if (ls + (li-lp) > len) {
DEBUG(0,("ERROR: string overflow by %d in string_sub(%.50s, %d)\n",
(int)(ls + (li-lp) - len),
pattern, (int)len));