Fix buffer overflow in helpfile processing. Bugreport from Anton Gorlov 2:5059/37

This commit is contained in:
Stas Degteff 2011-05-24 21:22:16 +00:00
parent a373628e84
commit fce08eec1e
3 changed files with 3 additions and 3 deletions

View File

@ -80,7 +80,7 @@ int ReadHelpCfg(int force) {
comment = NO;
HlpL[counter].help = atow(buf+3);
ptr = strchr(buf, ',');
strbtrim(strcpy(HlpL[counter].category, ptr ? ptr+1 : ""));
strbtrim(strxcpy(HlpL[counter].category, ptr ? ptr+1 : "", sizeof(HlpL[counter].category)));
HlpL[counter].offset = offset + strlen(buf);
counter++;
}

View File

@ -2823,7 +2823,7 @@ void MsgLineReIndex(GMsg* msg, int viewhidden, int viewkludge, int viewquote) {
line = line->next;
}
msg->line = (Line**)throw_xcalloc(msg->lines+2, sizeof(Line*));
msg->line = (Line**)throw_xcalloc(msg->lines+2, sizeof(Line*)); // FIXME: Memory Leak
x = 0;
msg->lines = 0;