Fixed too low malloc in clencode function

This commit is contained in:
Michiel Broek
2007-02-26 21:02:30 +00:00
parent f69200f40f
commit 0919143543
6 changed files with 12 additions and 11 deletions

View File

@@ -625,7 +625,7 @@ char *clencode(char *s)
if (s == NULL)
return NULL;
if ((buf = malloc(2 * strlen(s) + 1 * sizeof(char))) == NULL) {
if ((buf = malloc(3 * strlen(s) + 1 * sizeof(char))) == NULL) {
Syslog('+', "clencode: out of memory:string too long:\"%s\"", s);
return s;
}