int main(int argc, char *argv[])
{
- char *request_method;
+ char *request_method, *env;
int count, found, i;
uint8_t **hashes;
struct buffer_ctx cgipostbuf;
doerror("hashquery must be a HTTP POST request.\n");
}
- if (!(cgipostbuf.size = atoi(getenv("CONTENT_LENGTH")))) {
+ env = getenv("CONTENT_LENGTH");
+ if ((env == NULL) || !(cgipostbuf.size = atoi(env))) {
doerror("Must provide a content length.\n");
}