From 243995f36f4ee40aa88c1d29b976b944a3d1ac74 Mon Sep 17 00:00:00 2001 From: Bryce Anderson Date: Thu, 30 Apr 2015 20:56:28 -0400 Subject: Fix memory error and invalid param when no params are present Also added a unit test that fails with the previous behavior. Note that `-fsanitize=address` exposes the invalid memory access in qs_parse. --- include/query_string.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/query_string.h') diff --git a/include/query_string.h b/include/query_string.h index 86c99cc..03e5cfd 100644 --- a/include/query_string.h +++ b/include/query_string.h @@ -99,11 +99,12 @@ inline int qs_parse(char * qs, char * qs_kv[], int qs_kv_size) for(i=0; i