1
0
Fork 0
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:
Jordan Lee 2012-02-15 01:44:21 +00:00
parent bfaba32d79
commit ecfab318ed

View file

@ -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 );