summaryrefslogtreecommitdiff
path: root/ext/mime_magic
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2007-06-07 08:44:41 +0000
committerAntony Dovgal <tony2001@php.net>2007-06-07 08:44:41 +0000
commitc9805e7b9240c9513c4fb6add41b004328caf463 (patch)
tree44479ebe75a58ebcd0370f86de3a66d79130be1a /ext/mime_magic
parent91da96ba71867b72278aeb4d6deaff334c7f3771 (diff)
downloadphp-git-c9805e7b9240c9513c4fb6add41b004328caf463.tar.gz
MFH: check return value of *time_r() functions for NULL
Diffstat (limited to 'ext/mime_magic')
-rw-r--r--ext/mime_magic/mime_magic.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/mime_magic/mime_magic.c b/ext/mime_magic/mime_magic.c
index cb7be9950b..3828e43d47 100644
--- a/ext/mime_magic/mime_magic.c
+++ b/ext/mime_magic/mime_magic.c
@@ -1764,6 +1764,9 @@ static void mprint(union VALUETYPE *p, struct magic *m)
{
char ctimebuf[52];
pp = php_ctime_r((time_t *) &p->l, ctimebuf);
+ if (!pp) {
+ return;
+ }
if ((rt = strchr(pp, '\n')) != NULL) {
*rt = '\0';
}