net_http_update - prevent NULL pointer dereferences and return

false when erroring out
This commit is contained in:
twinaphex 2015-05-20 22:38:15 +02:00
parent 95821959a7
commit e010a6e0bf

View File

@ -507,11 +507,14 @@ parse_again:
return (state->part == P_DONE);
fail:
state->error = true;
state->part = P_ERROR;
state->status = -1;
if (state)
{
state->error = true;
state->part = P_ERROR;
state->status = -1;
}
return true;
return false;
}
int net_http_status(struct http_t *state)