Fixed possible buffer overflow
SVN revision: 1978
This commit is contained in:
+4
-2
@@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user