Skip to content

Commit

Permalink
Avoid core dumps due to malformed HTTP requests that led to MHD closi…
Browse files Browse the repository at this point in the history
…ng connections before Ulfius was able to process it and tried to free a struct _u_map before it was initialized. This fix avoids this by pre-initializing the structure, #40
  • Loading branch information
babelouest committed Feb 7, 2018
1 parent 941dfdf commit 23fa453
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ulfius.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ static void * ulfius_uri_logger (void * cls, const char * uri) {
if (con_info != NULL) {
con_info->callback_first_iteration = 1;
con_info->u_instance = NULL;
con_info->map_url_initial = NULL;
con_info->request = o_malloc(sizeof(struct _u_request));
if (con_info->request == NULL) {
y_log_message(Y_LOG_LEVEL_ERROR, "Ulfius - Error allocating memory for con_info->request");
Expand Down

0 comments on commit 23fa453

Please sign in to comment.