]> granicus.if.org Git - php/commitdiff
Make static analyzers happy
authorIlia Alshanetsky <iliaa@php.net>
Mon, 8 Aug 2011 12:10:27 +0000 (12:10 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 8 Aug 2011 12:10:27 +0000 (12:10 +0000)
ext/standard/head.c

index ec5ed95657479a60adf4bc0ca245d6407344c453..05f5fb4e5af9c637b9cc750733dc26e2b51d835b 100644 (file)
@@ -127,7 +127,7 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
                        dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, expires, 0 TSRMLS_CC);
                        /* check to make sure that the year does not exceed 4 digits in length */
                        p = zend_memrchr(dt, '-', strlen(dt));
-                       if (*(p + 5) != ' ') {
+                       if (!p || *(p + 5) != ' ') {
                                efree(dt);
                                efree(cookie);
                                efree(encoded_value);