]> granicus.if.org Git - php/commitdiff
MFB: Fixed bug #36644 (possible crash in variant_date_from_timestamp()).
authorIlia Alshanetsky <iliaa@php.net>
Mon, 13 Nov 2006 15:33:40 +0000 (15:33 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 13 Nov 2006 15:33:40 +0000 (15:33 +0000)
ext/com_dotnet/com_variant.c

index 07dc98d3c780295808fca8b203424fbe5544a4ae..620ff3fa88c29bbf642dcb06bb96a8c766140933 100644 (file)
@@ -806,6 +806,11 @@ PHP_FUNCTION(variant_date_from_timestamp)
                return;
        }
 
+       if (timestamp < 0) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timestamp value must be a positive value.");
+               RETURN_FALSE;
+       }
+
        VariantInit(&res);
        tzset();
        ttstamp = timestamp;