components/php-5_3/php-sapi/patches/171_php_18368630.patch
author Craig Mohrman <craig.mohrman@oracle.com>
Fri, 18 Apr 2014 11:03:12 -0700
branchs11u1-sru
changeset 3086 649b12aa87ce
permissions -rw-r--r--
17362112 problem in UTILITY/PHP 18083695 problem in UTILITY/PHP 18181920 remove BUILD_VERSION from php package manifests 18368537 problem in UTILITY/PHP 18368630 problem in UTILITY/PHP
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3086
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
     1
170_php_18368630.patch continued.
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
     2
This corrects parts of the above patch because of context diffs.
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
     3
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
     4
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
     5
--- php-5.3.28/ext/fileinfo/libmagic/softmagic.c_orig	2013-12-10 11:04:57.000000000 -0800
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
     6
+++ php-5.3.28/ext/fileinfo/libmagic/softmagic.c	2014-03-10 16:11:12.236393936 -0700
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
     7
@@ -1500,14 +1500,14 @@
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
     8
 	/* Verify we have enough data to match magic type */
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
     9
 	switch (m->type) {
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    10
 	case FILE_BYTE:
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    11
-		if (nbytes < (offset + 1)) /* should alway be true */
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    12
+		if (OFFSET_OOB(nbytes, offset, 1)) /* should alway be true */
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    13
 			return 0;
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    14
 		break;
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    15
 
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    16
 	case FILE_SHORT:
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    17
 	case FILE_BESHORT:
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    18
 	case FILE_LESHORT:
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    19
-		if (nbytes < (offset + 2))
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    20
+		if (OFFSET_OOB(nbytes, offset, 2))
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    21
 			return 0;
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    22
 		break;
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    23
 
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    24
@@ -1526,26 +1526,26 @@
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    25
 	case FILE_FLOAT:
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    26
 	case FILE_BEFLOAT:
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    27
 	case FILE_LEFLOAT:
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    28
-		if (nbytes < (offset + 4))
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    29
+		if (OFFSET_OOB(nbytes, offset, 4))
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    30
 			return 0;
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    31
 		break;
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    32
 
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    33
 	case FILE_DOUBLE:
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    34
 	case FILE_BEDOUBLE:
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    35
 	case FILE_LEDOUBLE:
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    36
-		if (nbytes < (offset + 8))
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    37
+		if (OFFSET_OOB(nbytes, offset, 8))
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    38
 			return 0;
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    39
 		break;
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    40
 
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    41
 	case FILE_STRING:
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    42
 	case FILE_PSTRING:
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    43
 	case FILE_SEARCH:
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    44
-		if (nbytes < (offset + m->vallen))
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    45
+		if (OFFSET_OOB(nbytes, offset, m->vallen))
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    46
 			return 0;
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    47
 		break;
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    48
 
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    49
 	case FILE_REGEX:
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    50
-		if (nbytes < offset)
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    51
+		if (OFFSET_OOB(nbytes, offset, 0))
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    52
 			return 0;
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    53
 		break;
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    54
 
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    55
@@ -1553,7 +1553,7 @@
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    56
 	  	if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    57
 		    file_printf(ms, "%s", m->desc) == -1)
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    58
 			return -1;
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    59
-		if (nbytes < offset)
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    60
+		if (OFFSET_OOB(nbytes, offset, 0))
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    61
 			return 0;
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    62
 		return file_softmagic(ms, s + offset, nbytes - offset,
649b12aa87ce 17362112 problem in UTILITY/PHP
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff changeset
    63
 		    BINTEST, text);