]> granicus.if.org Git - apache/commitdiff
mod_expires - don't segfault on bad configuration.
authorNick Kew <niq@apache.org>
Sat, 25 Aug 2007 05:55:37 +0000 (05:55 +0000)
committerNick Kew <niq@apache.org>
Sat, 25 Aug 2007 05:55:37 +0000 (05:55 +0000)
PR 43213: Julien Perez

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@569622 13f79535-47bb-0310-9956-ffa450edef68

modules/metadata/mod_expires.c

index caf9b2b70c37a9a3e0ef7ee4fc00b10ebb17f9a4..984ee9312a7299dc60ca1e3be2b647fda7195040 100644 (file)
@@ -321,6 +321,9 @@ static const char *set_expiresbytype(cmd_parms *cmd, void *in_dir_config,
     const char *check;
 
     check = ap_strrchr_c(mime, '/');
+    if (check == NULL) {
+        return "Invalid mimetype: should contain a slash";
+    }
     if ((strlen(++check) == 1) && (*check == '*')) {
         dir_config->wildcards = 1;
     }