1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-29 03:17:53 -04: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:
Jonas Fonseca 2007-07-24 12:47:35 +02:00
parent 39a50f07c0
commit efcd6c9758

View File

@ -1197,10 +1197,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 */