mirror of
https://github.com/samba-team/samba.git
synced 2025-08-15 13:49:28 +03:00
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 a5aad76006
)
This commit is contained in:
@ -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));
|
||||
|
Reference in New Issue
Block a user