1
0
mirror of https://github.com/moparisthebest/spdylay synced 2024-08-13 17:03:54 -04:00

Ensure read_callback is non-NULL for request bodies.

This commit is contained in:
Jim Morrison 2012-02-15 14:30:36 -08:00
parent f05a67641f
commit 63353ea486

View File

@ -124,7 +124,7 @@ int spdylay_submit_request(spdylay_session *session, uint8_t pri,
if(pri > 3) { if(pri > 3) {
return SPDYLAY_ERR_INVALID_ARGUMENT; return SPDYLAY_ERR_INVALID_ARGUMENT;
} }
if(data_prd) { if(data_prd != NULL && data_prd->read_callback != NULL) {
data_prd_copy = malloc(sizeof(spdylay_data_provider)); data_prd_copy = malloc(sizeof(spdylay_data_provider));
if(data_prd_copy == NULL) { if(data_prd_copy == NULL) {
return SPDYLAY_ERR_NOMEM; return SPDYLAY_ERR_NOMEM;