mirror of
https://github.com/transmission/transmission
synced 2025-03-03 18:25:35 +00:00
(trunk libT) fix potential NULL pointer dereference in rpc-server.c's crude mime multipart parser
This commit is contained in:
parent
bfaba32d79
commit
ecfab318ed
1 changed files with 1 additions and 1 deletions
|
@ -160,7 +160,7 @@ extract_parts_from_multipart( const struct evkeyvalq * headers,
|
|||
size_t inlen = evbuffer_get_length( body );
|
||||
|
||||
const char * boundary_key = "boundary=";
|
||||
const char * boundary_key_begin = strstr( content_type, boundary_key );
|
||||
const char * boundary_key_begin = content_type ? strstr( content_type, boundary_key ) : NULL;
|
||||
const char * boundary_val = boundary_key_begin ? boundary_key_begin + strlen( boundary_key ) : "arglebargle";
|
||||
char * boundary = tr_strdup_printf( "--%s", boundary_val );
|
||||
const size_t boundary_len = strlen( boundary );
|
||||
|
|
Loading…
Reference in a new issue