components/ksh93/patches/225-17817727.patch
author Lijo George<lijo.x.george@oracle.com>
Sun, 10 May 2015 11:59:46 -0700
changeset 4268 d723f8ed85fe
permissions -rw-r--r--
PSARC/2014/162 ksh93 update to 2012-08-01 17533968 ksh93 uprev to latest community version 17817727 ksh93: Right shift arithmetic substitution error for shifts of 64 bits or more 17699248 ksh93 double associative array handling bugs 17777549 "kill %%" with no background jobs , coredumps 18119738 ksh93 crashes in sfio area 18229654 ksh93 read not reentrant in alarm context dumps core 16169978 ksh93 memory corruption with redirection 18302723 ksh93 segv in sh_setmatch 16507675 external command in double-nested here-document hangs ksh93 18920300 remove pkglint Warnings in ksh93 build 18355790 /usr/bin/sh and /usr/sbin/sh should point to /usr/bin/ksh93 19907453 Session drop can cause ksh93 to become a fork bomb 18426052 SPARC /usr/bin/ksh is not an XPG6 executable 20808157 attpackagemake.mk test target needs the same environment as the build 20948390 ksh93 should have some master test results to compare against 20948350 attpackagemake.mk tested-and-compared target has mis-matched parentheses
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4268
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
     1
This fix is from the community, details in the following location.
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
     2
http://lists.research.att.com/pipermail/ast-users/2013q4/004481.html
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
     3
---
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
     4
--- a/src/cmd/ksh93/sh/streval.c	2014-01-22 10:39:11.075964500 +0100
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
     5
+++ b/src/cmd/ksh93/sh/streval.c	2014-01-22 13:21:35.999184260 +0100
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
     6
@@ -366,13 +366,17 @@
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
     7
 				num = (Sflong_t)(sp[-1]) / (Sflong_t)(num);
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
     8
 			break;
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
     9
 		    case A_LSHIFT:
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    10
-			if(tp[-1]==2)
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    11
+			if((long)num >= CHAR_BIT*sizeof(Sfulong_t))
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    12
+				num = 0;
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    13
+			else if(tp[-1]==2)
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    14
 				num = U2F((Sfulong_t)(sp[-1]) << (long)(num));
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    15
 			else
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    16
 				num = (Sflong_t)(sp[-1]) << (long)(num);
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    17
 			break;
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    18
 		    case A_RSHIFT:
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    19
-			if(tp[-1]==2)
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    20
+			if((long)num >= CHAR_BIT*sizeof(Sfulong_t))
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    21
+				num = 0;
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    22
+			else if(tp[-1]==2)
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    23
 				num = U2F((Sfulong_t)(sp[-1]) >> (long)(num));
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    24
 			else
d723f8ed85fe PSARC/2014/162 ksh93 update to 2012-08-01
Lijo George<lijo.x.george@oracle.com>
parents:
diff changeset
    25
 				num = (Sflong_t)(sp[-1]) >> (long)(num);