Bug 7676 - Infinite loops in /usr/lib/perl5/5.00503/i386-linux/bits/socket.ph
Summary: Infinite loops in /usr/lib/perl5/5.00503/i386-linux/bits/socket.ph
Keywords:
Status: CLOSED DUPLICATE of bug 2297
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: perl
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Crutcher Dunnavant
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-12-08 03:29 UTC by Jonathan Kamens
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-01-15 15:14:53 UTC


Attachments (Terms of Use)

Description Jonathan Kamens 1999-12-08 03:29:41 UTC
A number of the subroutines defined in
/usr/lib/perl5/5.00503/i386-linux/bits/socket.ph introduce infinite loops,
such that if they are included the program will recurse until it runs out
of memory.

The following patch shows where the problems are and how to fix them.

--- socket.ph~	Sun Nov 21 21:33:51 1999
+++ socket.ph	Tue Dec  7 22:33:09 1999
@@ -9,12 +9,12 @@
     eval 'sub __need_NULL {1;}' unless defined(&__need_NULL);
     require 'stddef.ph';
     require 'sys/types.ph';
-    eval 'sub SOCK_STREAM () { &SOCK_STREAM;}' unless
defined(&SOCK_STREAM);
-    eval 'sub SOCK_DGRAM () { &SOCK_DGRAM;}' unless defined(&SOCK_DGRAM);
-    eval 'sub SOCK_RAW () { &SOCK_RAW;}' unless defined(&SOCK_RAW);
-    eval 'sub SOCK_RDM () { &SOCK_RDM;}' unless defined(&SOCK_RDM);
-    eval 'sub SOCK_SEQPACKET () { &SOCK_SEQPACKET;}' unless
defined(&SOCK_SEQPACKET);
-    eval 'sub SOCK_PACKET () { &SOCK_PACKET;}' unless
defined(&SOCK_PACKET);
+    eval 'sub SOCK_STREAM () { 1;}' unless defined(&SOCK_STREAM);
+    eval 'sub SOCK_DGRAM () { 2;}' unless defined(&SOCK_DGRAM);
+    eval 'sub SOCK_RAW () { 3;}' unless defined(&SOCK_RAW);
+    eval 'sub SOCK_RDM () { 4;}' unless defined(&SOCK_RDM);
+    eval 'sub SOCK_SEQPACKET () { 5;}' unless defined(&SOCK_SEQPACKET);
+    eval 'sub SOCK_PACKET () { 10;}' unless defined(&SOCK_PACKET);
     eval 'sub PF_UNSPEC () {0;}' unless defined(&PF_UNSPEC);
     eval 'sub PF_LOCAL () {1;}' unless defined(&PF_LOCAL);
     eval 'sub PF_UNIX () { &PF_LOCAL;}' unless defined(&PF_UNIX);
@@ -74,14 +74,14 @@
     eval 'sub SOL_X25 () {262;}' unless defined(&SOL_X25);
     eval 'sub SOMAXCONN () {128;}' unless defined(&SOMAXCONN);
     require 'bits/sockaddr.ph';
-    eval 'sub MSG_OOB () { &MSG_OOB;}' unless defined(&MSG_OOB);
-    eval 'sub MSG_PEEK () { &MSG_PEEK;}' unless defined(&MSG_PEEK);
-    eval 'sub MSG_DONTROUTE () { &MSG_DONTROUTE;}' unless
defined(&MSG_DONTROUTE);
+    eval 'sub MSG_OOB () { 1;}' unless defined(&MSG_OOB);
+    eval 'sub MSG_PEEK () { 2;}' unless defined(&MSG_PEEK);
+    eval 'sub MSG_DONTROUTE () { 4;}' unless defined(&MSG_DONTROUTE);
     if(defined(&__USE_GNU)) {
 	eval 'sub MSG_TRYHARD () { &MSG_DONTROUTE;}' unless
defined(&MSG_TRYHARD);
     }
-    eval 'sub MSG_CTRUNC () { &MSG_CTRUNC;}' unless defined(&MSG_CTRUNC);
-    eval 'sub MSG_PROXY () { &MSG_PROXY;}' unless defined(&MSG_PROXY);
+    eval 'sub MSG_CTRUNC () { 8;}' unless defined(&MSG_CTRUNC);
+    eval 'sub MSG_PROXY () { 16;}' unless defined(&MSG_PROXY);
     if(!defined (defined(&__STRICT_ANSI__) ? &__STRICT_ANSI__ : 0)  &&
defined (defined(&__GNUC__) ? &__GNUC__ : 0)  && (defined(&__GNUC__) ?
&__GNUC__ : 0) >= 2) {
     }
     if(!defined (defined(&__STRICT_ANSI__) ? &__STRICT_ANSI__ : 0)  &&
defined (defined(&__GNUC__) ? &__GNUC__ : 0)  && (defined(&__GNUC__) ?
&__GNUC__ : 0) >= 2) {
@@ -120,9 +120,9 @@
 	    eval 'sub _EXTERN_INLINE () { &extern  &__inline;}' unless
defined(&_EXTERN_INLINE);
 	}
     }
-    eval 'sub SCM_RIGHTS () { &SCM_RIGHTS;}' unless defined(&SCM_RIGHTS);
+    eval 'sub SCM_RIGHTS () { 1;}' unless defined(&SCM_RIGHTS);
     if(defined(&__USE_BSD)) {
-	eval 'sub SCM_CREDENTIALS () { &SCM_CREDENTIALS;}' unless
defined(&SCM_CREDENTIALS);
+	eval 'sub SCM_CREDENTIALS () { 2;}' unless defined(&SCM_CREDENTIALS);
     }
     require 'asm/socket.ph';
 }

Comment 1 Jeff Johnson 2000-01-15 15:14:59 UTC
*** This bug has been marked as a duplicate of 2297 ***


Note You need to log in before you can comment on or make changes to this bug.