mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-10 18:23:28 +00:00
Fixed possible buffer overflow
SVN revision: 1978
This commit is contained in:
parent
9ffc0f41d4
commit
15ff5f3ae0
@ -265,8 +265,10 @@ void convert_crlf(char *buffer, int bufsize)
|
|||||||
p = buffer;
|
p = buffer;
|
||||||
while ((p = strstr(p, "\\n")) != NULL) {
|
while ((p = strstr(p, "\\n")) != NULL) {
|
||||||
|
|
||||||
*(p++) = '\r';
|
if ((int)p - (int)buffer < bufsize-2) {
|
||||||
*(p++) = '\n';
|
*(p++) = '\r';
|
||||||
|
*(p++) = '\n';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user