Skip to content

Commit 656fecf

Browse files
committed
Disallow comma character as query separator, fixes issue #38
1 parent 28eae0f commit 656fecf

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
2.4.11
12
- Features
23
- Bindings: EndPointReference.selector_names() for Python
34
- Bugfixes
5+
- URI parsing: Disallow comma to separate selectors in resource uri,
6+
only ampersand is allowed. (issue #38)
47
- Bindings: Fix Ruby doc generation
58

69
2.4.10

src/lib/u/uri.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,19 +218,23 @@ hash_t *u_parse_query(const char *query)
218218
dbg_err_if(key == NULL);
219219

220220
val = strchr(key, '=');
221-
dbg_err_if(val == NULL);
221+
if (val == NULL) {
222+
warn("Missing '=' character in query: %s", tok);
223+
goto err;
224+
}
222225

223226
/* zero-term the name part and set the value pointer */
224227
*val++ = 0;
225228
val = u_strdup(val);
229+
dbg_err_if(val == NULL);
226230

227231
u_trim(key);
228232
u_trim(val);
229233
u_trim_quotes(val);
230234
if (u_string_unify(key) || u_string_unify(val)) {
231235
u_free(key);
232236
u_free(val);
233-
dbg("Could not unify query: %s", tok);
237+
warn("Could not unify %%nn sequences in query: %s", tok);
234238
continue;
235239
}
236240
if (!hash_lookup(h, key)) {

0 commit comments

Comments
 (0)