diff --git a/ChangeLog b/ChangeLog index 530f31c..c380387 100644 --- a/ChangeLog +++ b/ChangeLog @@ -211,6 +211,31 @@ Version 1.8.0 Version 1.6.7 ******************************************************************************* +2010-06-28 Marcelo Jimenez + SF Bug Tracker [ 3022490 ] String declaration fix for patch applied in 3007407 + Hello, + + When my patch for tracker ID 3007407 was accepted, the definition of the + serviceList string was changed from + + #define SERVICELIST_STR "serviceList" + + to + + static const char *SERVICELIST_STR = "serviceList"; + + During internal code review of the final patch, it was pointed out that + sizeof(SERVICELIST_STR) == 4 since SERVICELIST_STR is now declared as + a pointer instead of an array. + + If you wish to use a variable instead of a define, I suggest the + following instead: + + static const char SERVICELIST_STR[] = "serviceList"; + + Thanks, + Chuck Thomason + 2010-06-10 Marcelo Jimenez SF Bug Tracker [ 3007407 ] Service traversal issue in AdvertiseAndReply() Submitted: Chuck Thomason ( cyt4 ) - 2010-05-26 15:07:39 UTC diff --git a/upnp/src/ssdp/ssdp_server.c b/upnp/src/ssdp/ssdp_server.c index 6e31908..8362069 100644 --- a/upnp/src/ssdp/ssdp_server.c +++ b/upnp/src/ssdp/ssdp_server.c @@ -96,7 +96,7 @@ struct SSDPSockArray { * Returns: int * UPNP_E_SUCCESS if successful else appropriate error ***************************************************************************/ -static const char *SERVICELIST_STR = "serviceList"; +static const char SERVICELIST_STR[] = "serviceList"; int AdvertiseAndReply( IN int AdFlag, @@ -289,7 +289,7 @@ int AdvertiseAndReply( tmpNode = ixmlNode_getFirstChild(tmpNode); while (tmpNode) { dbgStr = ixmlNode_getNodeName(tmpNode); - if (!strncmp(dbgStr, SERVICELIST_STR, sizeof(SERVICELIST_STR))) { + if (!strncmp(dbgStr, SERVICELIST_STR, sizeof SERVICELIST_STR)) { break; } tmpNode = ixmlNode_getNextSibling(tmpNode);