mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
(trunk libT) fix potential NULL pointer dereference in rpc-server.c's crude mime multipart parser
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user