Skip to content

Commit 36848d5

Browse files
committed
syslog: fix error with memmove after realloc
Signed-off-by: Christopher Degawa <[email protected]>
1 parent 5df722e commit 36848d5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compat/win32/syslog.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ void syslog(int priority, const char *fmt, ...)
5050
warning_errno("realloc failed");
5151
return;
5252
}
53+
if (pos != str + (pos - oldstr))
54+
pos = strstr(str, "%1");
5355
memmove(pos + 2, pos + 1, strlen(pos));
5456
pos[1] = ' ';
5557
}

0 commit comments

Comments
 (0)