1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-06 22:10:53 +00:00

Bug 869: use safe_strncpy when initializing the program field

This cleans up the previous fix and also fixes the problem mentioned
regarding ELinks still crashing when the first character is removed.

[ Squashed the original fix in, corrected the bug number, and added a
  NEWS entry.  --KON ]
This commit is contained in:
Jonas Fonseca 2007-07-24 12:47:35 +02:00 committed by Kalle Olavi Niemitalo
parent 63a5ae0320
commit 2e174e5e05
2 changed files with 2 additions and 4 deletions

1
NEWS
View File

@ -11,6 +11,7 @@ ELinks 0.11.7.GIT now:
To be released as 0.11.8.
* serious Debian bug 464384: fix cast warning in alignof
* bug 869: fix a buffer overflow segfault in do_type_query
* minor bug 1113: fix a small memory leak if a mailcap file is malformed
ELinks 0.11.7:

View File

@ -1090,10 +1090,7 @@ do_type_query(struct type_query *type_query, unsigned char *ct, struct mime_hand
}
if (handler && handler->program) {
int programlen = strlen(handler->program);
programlen = int_max(programlen, MAX_STR_LEN);
memcpy(field, handler->program, programlen);
safe_strncpy(field, handler->program, MAX_STR_LEN);
}
/* xgettext:no-c-format */