From 2afc1ca42c6a945fa1385328cd1c69065829d233 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 18 Jul 2002 22:55:48 +0000 Subject: 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. (This used to be commit a5aad760061e21635319a9b5628990cf59b827ed) --- source3/lib/util_str.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index 88a72f1536..7da4358e66 100644 --- a/source3/lib/util_str.c +++ b/source3/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)); -- cgit