Fixed possible buffer overflow

SVN revision: 1978
This commit is contained in:
2007-12-13 07:08:19 +00:00
parent 9ffc0f41d4
commit 15ff5f3ae0
+4 -2
View File
@@ -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';
}
}
}