summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/gd/gd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index a14b8981f2..b471daa372 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -708,7 +708,7 @@ PHP_FUNCTION(imagejpeg)
}
}
- if (argc > 1 && strlen(fn)) {
+ if (argc > 1 && fn && strlen(fn)) {
fp = fopen(fn, "wb");
if (!fp) {
php_error(E_WARNING, "ImageJpeg: unable to open %s for writing", fn);