mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -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
39a50f07c0
commit
efcd6c9758
@ -1197,10 +1197,7 @@ do_type_query(struct type_query *type_query, unsigned char *ct, struct mime_hand
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (handler && handler->program) {
|
if (handler && handler->program) {
|
||||||
int programlen = strlen(handler->program);
|
safe_strncpy(field, handler->program, MAX_STR_LEN);
|
||||||
|
|
||||||
programlen = int_min(programlen, MAX_STR_LEN);
|
|
||||||
memcpy(field, handler->program, programlen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* xgettext:no-c-format */
|
/* xgettext:no-c-format */
|
||||||
|
Loading…
Reference in New Issue
Block a user