mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
Bug 896: 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.
This commit is contained in:
parent
07b0598064
commit
8911b9283c
@ -1215,10 +1215,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_min(programlen, MAX_STR_LEN);
|
||||
memcpy(field, handler->program, programlen);
|
||||
safe_strncpy(field, handler->program, MAX_STR_LEN);
|
||||
}
|
||||
|
||||
/* xgettext:no-c-format */
|
||||
|
Loading…
Reference in New Issue
Block a user