@@ -2633,14 +2633,15 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
26332633 } else {
26342634 decode = ImageInfo -> decode_unicode_le ;
26352635 }
2636+ /* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
26362637 if (zend_multibyte_encoding_converter (
26372638 (unsigned char * * )pszInfoPtr ,
26382639 & len ,
26392640 (unsigned char * )szValuePtr ,
26402641 ByteCount ,
26412642 zend_multibyte_fetch_encoding (ImageInfo -> encode_unicode TSRMLS_CC ),
26422643 zend_multibyte_fetch_encoding (decode TSRMLS_CC )
2643- TSRMLS_CC ) < 0 ) {
2644+ TSRMLS_CC ) == ( size_t ) -1 ) {
26442645 len = exif_process_string_raw (pszInfoPtr , szValuePtr , ByteCount );
26452646 }
26462647 return len ;
@@ -2653,14 +2654,15 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
26532654 * pszEncoding = estrdup ((const char * )szValuePtr );
26542655 szValuePtr = szValuePtr + 8 ;
26552656 ByteCount -= 8 ;
2657+ /* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
26562658 if (zend_multibyte_encoding_converter (
26572659 (unsigned char * * )pszInfoPtr ,
26582660 & len ,
26592661 (unsigned char * )szValuePtr ,
26602662 ByteCount ,
26612663 zend_multibyte_fetch_encoding (ImageInfo -> encode_jis TSRMLS_CC ),
26622664 zend_multibyte_fetch_encoding (ImageInfo -> motorola_intel ? ImageInfo -> decode_jis_be : ImageInfo -> decode_jis_le TSRMLS_CC )
2663- TSRMLS_CC ) < 0 ) {
2665+ TSRMLS_CC ) == ( size_t ) -1 ) {
26642666 len = exif_process_string_raw (pszInfoPtr , szValuePtr , ByteCount );
26652667 }
26662668 return len ;
@@ -2690,16 +2692,16 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
26902692static int exif_process_unicode (image_info_type * ImageInfo , xp_field_type * xp_field , int tag , char * szValuePtr , int ByteCount TSRMLS_DC )
26912693{
26922694 xp_field -> tag = tag ;
2693-
2694- /* Copy the comment */
2695+
2696+ /* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
26952697 if (zend_multibyte_encoding_converter (
26962698 (unsigned char * * )& xp_field -> value ,
26972699 & xp_field -> size ,
26982700 (unsigned char * )szValuePtr ,
26992701 ByteCount ,
27002702 zend_multibyte_fetch_encoding (ImageInfo -> encode_unicode TSRMLS_CC ),
27012703 zend_multibyte_fetch_encoding (ImageInfo -> motorola_intel ? ImageInfo -> decode_unicode_be : ImageInfo -> decode_unicode_le TSRMLS_CC )
2702- TSRMLS_CC ) < 0 ) {
2704+ TSRMLS_CC ) == ( size_t ) -1 ) {
27032705 xp_field -> size = exif_process_string_raw (& xp_field -> value , szValuePtr , ByteCount );
27042706 }
27052707 return xp_field -> size ;
0 commit comments