@@ -4312,6 +4312,8 @@ static int exif_read_from_stream(image_info_type *ImageInfo, php_stream *stream,
4312
4312
int ret ;
4313
4313
zend_stat_t st ;
4314
4314
4315
+ php_printf ("exif_read_from_stream" );
4316
+
4315
4317
/* Start with an empty image information structure. */
4316
4318
memset (ImageInfo , 0 , sizeof (* ImageInfo ));
4317
4319
@@ -4375,6 +4377,8 @@ static int exif_read_from_file(image_info_type *ImageInfo, char *FileName, int r
4375
4377
int ret ;
4376
4378
php_stream * stream ;
4377
4379
4380
+ php_printf ("exif_read_from_file" );
4381
+
4378
4382
stream = php_stream_open_wrapper (FileName , "rb" , STREAM_MUST_SEEK | IGNORE_PATH , NULL );
4379
4383
4380
4384
if (!stream ) {
@@ -4454,6 +4458,12 @@ PHP_FUNCTION(exif_read_data)
4454
4458
} else {
4455
4459
convert_to_string (stream );
4456
4460
4461
+ if (!Z_STRLEN_P (stream )) {
4462
+ exif_error_docref (NULL EXIFERR_CC , & ImageInfo , E_WARNING , "Filename cannot be empty ");
4463
+
4464
+ RETURN_FALSE ;
4465
+ }
4466
+
4457
4467
ret = exif_read_from_file (& ImageInfo , Z_STRVAL_P (stream ), read_thumbnail , read_all );
4458
4468
}
4459
4469
@@ -4618,6 +4628,12 @@ PHP_FUNCTION(exif_thumbnail)
4618
4628
} else {
4619
4629
convert_to_string (stream );
4620
4630
4631
+ if (!Z_STRLEN_P (stream )) {
4632
+ exif_error_docref (NULL EXIFERR_CC , & ImageInfo , E_WARNING , "Filename cannot be empty ");
4633
+
4634
+ RETURN_FALSE ;
4635
+ }
4636
+
4621
4637
ret = exif_read_from_file (& ImageInfo , Z_STRVAL_P (stream ), 1 , 0 );
4622
4638
}
4623
4639
0 commit comments