Prevented potential memory fault with burn_set_signal_handling()

This commit is contained in:
2010-03-08 09:24:21 +00:00
parent ed6e2df81b
commit cdad7fcd80
3 changed files with 7 additions and 4 deletions

View File

@ -490,7 +490,8 @@ void burn_set_signal_handling(void *handle, burn_abort_handler_t handler,
}
strcpy(abort_message_prefix, "libburn : ");
if(handle != NULL)
abort_message_prefix[0] = 0;
if(handle != NULL && handler == burn_builtin_abort_handler)
strncpy(abort_message_prefix, (char *) handle,
sizeof(abort_message_prefix)-1);
abort_message_prefix[sizeof(abort_message_prefix)-1] = 0;