From 3629452fe0e249af50dea14d75dfcfd56d0abdc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kan-Ru=20Chen=20=28=E9=99=B3=E4=BE=83=E5=A6=82=29?= Date: Mon, 4 Aug 2014 01:07:37 +0800 Subject: [PATCH] Fix pcre_exec's return type According to PCRE_EXEC(3) pcre_exec returns int. The original code uses char but char could be either signed or unsigned. On armel and sparc this caused segment fault because the (rc < 0) error checking was optimized out. --- src/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.c b/src/node.c index cccfba1..79abdc6 100644 --- a/src/node.c +++ b/src/node.c @@ -327,7 +327,7 @@ node * r3_tree_matchl(const node * n, const char * path, int path_len, match_ent const char *substring_start = NULL; int substring_length = 0; int ov[ n->ov_cnt ]; - char rc; + int rc; info("pcre matching %s on %s\n", n->combined_pattern, path);