diff --git a/ChangeLog b/ChangeLog index 951e991..8253f78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,15 @@ Version 1.6.16 ******************************************************************************* +2012-02-27 Fabrice Fontaine + + SF Bug Tracker id 3494865 - Use of non-initialized variable in parser_parse_requestline + + Submitted: Marcelo Roberto Jimenez ( mroberto ) - 2012-02-26 16:50:23 PST + + src/genlib/net/http/httpparser.c: In function ‘parser_parse_requestline’: + src/genlib/net/http/httpparser.c:1319:28: warning: ‘index’ may be used uninitialized in this function + 2012-02-24 Marcelo Roberto Jimenez SF Bug Tracker id 3489999 - UpnpString leaks in genaSubscribe() diff --git a/upnp/src/genlib/net/http/httpparser.c b/upnp/src/genlib/net/http/httpparser.c index ccfaa59..bf0a381 100644 --- a/upnp/src/genlib/net/http/httpparser.c +++ b/upnp/src/genlib/net/http/httpparser.c @@ -2,6 +2,7 @@ * * Copyright (c) 2000-2003 Intel Corporation * All rights reserved. + * Copyright (c) 2012 France Telecom All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -1303,6 +1304,16 @@ parser_parse_requestline( INOUT http_parser_t * parser ) HTTP_SUCCESS ) { return PARSE_FAILURE; } + + index = + map_str_to_int( method_str.buf, method_str.length, + Http_Method_Table, NUM_HTTP_METHODS, TRUE ); + if( index < 0 ) { + /* error; method not found */ + parser->http_error_code = HTTP_NOT_IMPLEMENTED; + return PARSE_FAILURE; + } + /* scan version */ save_char = version_str.buf[version_str.length]; version_str.buf[version_str.length] = '\0'; /* null-terminate */ @@ -1320,15 +1331,6 @@ parser_parse_requestline( INOUT http_parser_t * parser ) return PARSE_FAILURE; } - index = - map_str_to_int( method_str.buf, method_str.length, - Http_Method_Table, NUM_HTTP_METHODS, TRUE ); - if( index < 0 ) { - /* error; method not found */ - parser->http_error_code = HTTP_NOT_IMPLEMENTED; - return PARSE_FAILURE; - } - hmsg->method = Http_Method_Table[index].id; parser->position = POS_HEADERS; /* move to headers */