# HG changeset patch # User John Calcote # Date 1491502259 21600 # Thu Apr 06 12:10:59 2017 -0600 # Node ID 52e64208bc616a5def0f4d337c1adc18c23ef3ec # Parent f9f53696e6bea9976d3c0e5c6825b9d7a026be7c CVE-2012-4428: fix handling of string-list in slp_common.c diff --git a/openslp/common/slp_compare.c b/openslp/common/slp_compare.c --- a/openslp/common/slp_compare.c +++ b/openslp/common/slp_compare.c @@ -588,13 +588,10 @@ /* seek to the end of the next list item */ while(1) { - if(itemend == listend || *itemend == ',') - { - if(*(itemend - 1) != '\\') - { - break; - } - } + if(itemend == listend) + break; + if(*itemend == ',' && *(itemend - 1) != '\\') + break; itemend++; } @@ -684,9 +681,10 @@ /* seek to the end of the next list item */ while (1) { - if (itemend == listend || *itemend == ',') - if (*(itemend - 1) != '\\') - break; + if(itemend == listend) + break; + if(*itemend == ',' && *(itemend - 1) != '\\') + break; itemend++; }