projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Documentation rebuilt if local.ent changes
[yaz-moved-to-github.git]
/
src
/
uri.c
diff --git
a/src/uri.c
b/src/uri.c
index
1d30cda
..
33120ed
100644
(file)
--- a/
src/uri.c
+++ b/
src/uri.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2012 Index Data
+ * Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
*/
/**
* See the file LICENSE for details.
*/
/**
@@
-101,7
+101,7
@@
void yaz_array_to_uri(char **path, ODR o, char **name, char **value)
for(i = 0; name[i]; i++)
sz += strlen(name[i]) + 3 + strlen(value[i]) * 3;
*path = (char *) odr_malloc(o, sz);
for(i = 0; name[i]; i++)
sz += strlen(name[i]) + 3 + strlen(value[i]) * 3;
*path = (char *) odr_malloc(o, sz);
-
+
for(i = 0; name[i]; i++)
{
size_t ilen;
for(i = 0; name[i]; i++)
{
size_t ilen;
@@
-132,6
+132,13
@@
int yaz_uri_to_array(const char *path, ODR o, char ***name, char ***val)
{
cp++;
no++;
{
cp++;
no++;
+ while (*cp && *cp != '=' && *cp != '&')
+ {
+ /* check that x-form names looks sane */
+ if (*cp <= ' ' || *cp >= 127)
+ return 0;
+ cp++;
+ }
}
*name = (char **) odr_malloc(o, no * sizeof(char*));
*val = (char **) odr_malloc(o, no * sizeof(char*));
}
*name = (char **) odr_malloc(o, no * sizeof(char*));
*val = (char **) odr_malloc(o, no * sizeof(char*));
@@
-190,7
+197,7
@@
char *yaz_uri_val(const char *path, const char *name, ODR o)
{
size_t i = 0;
char *ret;
{
size_t i = 0;
char *ret;
-
+
path = p1 + 1;
p1 = strchr(path, '&');
if (!p1)
path = p1 + 1;
p1 = strchr(path, '&');
if (!p1)