From c0bb739e3cd49e1eca5745932aa59c5651d1d924 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 28 Mar 2010 18:02:22 +0000 Subject: [PATCH] Fix a regression introduced with the previous commit. The (url_param[0] != '\0') check wasn't supposed to prevent strstr() from segfaulting (which makes no sense), but to detect whether or not an URL has been specified. 'Optimizing' it away was thus a dumb move. --- cgisimple.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cgisimple.c b/cgisimple.c index 11781bd8..46ffb151 100644 --- a/cgisimple.c +++ b/cgisimple.c @@ -1,4 +1,4 @@ -const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.97 2010/03/07 12:07:51 fabiankeil Exp $"; +const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.98 2010/03/27 18:29:59 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $ @@ -1105,8 +1105,9 @@ jb_err cgi_show_url_info(struct client_state *csp, url_param[0] = '\0'; } } - else if ((NULL == strstr(url_param, "://") - || (strstr(url_param, "://") > strstr(url_param, "/")))) + else if ((url_param[0] != '\0') + && ((NULL == strstr(url_param, "://") + || (strstr(url_param, "://") > strstr(url_param, "/"))))) { /* * No prefix or at least no prefix before -- 2.39.2