Permalink
Browse files

pn_util: trivial improvement in pn_html_unescape

Just in case.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
  • Loading branch information...
1 parent ff9363b commit f1d81fdff1322480a1a638c1129970cce81822de @felipec committed May 14, 2011
Showing with 1 addition and 2 deletions.
  1. +1 −2 pn_util.c
View
@@ -912,10 +912,9 @@ pn_html_unescape (const char *url)
unsigned i;
for (i = 0; i < ARRAY_SIZE(refs); i++) {
struct ref ref = refs[i];
- int len = strlen(ref.name);
+ int len = MIN(strlen(ref.name), (size_t)(end - src));
if (strncmp (src, ref.name, len) == 0) {
dest = g_string_append (dest, ref.value);
- src += len;
break;
}
}

0 comments on commit f1d81fd

Please sign in to comment.