1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -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 committed by Witold Filipczyk
parent 07b0598064
commit 8911b9283c

View File

@ -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 */