Skip to content

Commit

Permalink
Fixed issue where an index in qs_parse is incorrectly incremented bey…
Browse files Browse the repository at this point in the history
…ond the maximum possible value
  • Loading branch information
The-EDev committed Jun 27, 2022
1 parent 75c522f commit 79eec91
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/crow/query_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,10 @@ inline int qs_parse(char* qs, char* qs_kv[], int qs_kv_size, bool parse_url = tr
{
qs_kv[i] = substr_ptr;
j = strcspn(substr_ptr, "&");
if ( substr_ptr[j] == '\0' ) { break; }
if ( substr_ptr[j] == '\0' ) { i++; break; } // x &'s -> means x iterations of this loop -> means *x+1* k/v pairs
substr_ptr += j + 1;
i++;
}
i++; // x &'s -> means x iterations of this loop -> means *x+1* k/v pairs

// we only decode the values in place, the keys could have '='s in them
// which will hose our ability to distinguish keys from values later
Expand Down

0 comments on commit 79eec91

Please sign in to comment.