]> 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 edaf7674634b11916760c825d33ee25e11233318..5ddc304adc786f1aec1be6775ce40a10e8816b98 100644 (file)
@@ -128,7 +128,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);