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

(cherry picked from commit 79eec91)
  • Loading branch information
The-EDev committed Jun 28, 2022
1 parent 25dc741 commit 62dae4c
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 @@ -115,11 +115,10 @@ inline int qs_parse(char * qs, char * qs_kv[], int qs_kv_size)
{
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 62dae4c

Please sign in to comment.