1
0
mirror of https://github.com/php/php-src.git synced 2026-04-11 10:03:18 +02:00

fix for segfault. patch from Jade Nicoletti <nicoletti@nns.ch>.

This commit is contained in:
Chuck Hagenbuch
2000-05-10 12:44:44 +00:00
parent 33f8ab3800
commit fe22dc5ff8

View File

@@ -3461,7 +3461,7 @@ PHP_FUNCTION(imap_mime_header_decode)
}
if ((encoding_token=(long) php_memnstr(&string[charset_token+2], "?", 1, string+end))) { /* Find token for encoding */
encoding_token -= (long) string;
if ((end_token=(long) php_memnstr(&string[encoding_token+1], "?=", 2, string+end))) { /* Find token for end of encoded data */
if ((end_token=(long) php_memnstr(&string[encoding_token+3], "?=", 2, string+end))) { /* Find token for end of encoded data */
end_token -= (long) string;
memcpy(charset, &string[charset_token+2], encoding_token-(charset_token+2)); /* Extract charset encoding */
charset[encoding_token-(charset_token+2)]=0x00;