mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +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;
|
||||
while ((p = strstr(p, "\\n")) != NULL) {
|
||||
|
||||
*(p++) = '\r';
|
||||
*(p++) = '\n';
|
||||
if ((int)p - (int)buffer < bufsize-2) {
|
||||
*(p++) = '\r';
|
||||
*(p++) = '\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user