Avoid a null pointer dereference, so 'xargs <<< ${EMTPY_VARIABLE}'
will not segfault and dump core. Submitted by: Robert Nagy <robert@openbsd.org>
This commit is contained in:
parent
eeea5a46e1
commit
edd5ce97c3
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=111891
6 changed files with 63 additions and 3 deletions
|
@ -8,7 +8,7 @@
|
|||
|
||||
PORTNAME= bash
|
||||
PORTVERSION= 2.05b.007
|
||||
PORTREVISION?= 0
|
||||
PORTREVISION?= 1
|
||||
CATEGORIES= shells
|
||||
MASTER_SITES= ${MASTER_SITE_GNU} \
|
||||
ftp://ftp.cwru.edu/pub/bash/
|
||||
|
|
20
shells/bash/files/patch-redir.c
Normal file
20
shells/bash/files/patch-redir.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
Index: files/patch-redir.c
|
||||
===================================================================
|
||||
RCS file: files/patch-redir.c
|
||||
diff -N files/patch-redir.c
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ files/patch-redir.c 20 Jun 2004 15:40:43 -0000
|
||||
@@ -0,0 +1,11 @@
|
||||
+--- redir.c.orig Sun Jun 20 18:00:47 2004
|
||||
++++ redir.c Sun Jun 20 18:01:25 2004
|
||||
+@@ -263,7 +263,7 @@
|
||||
+ int herelen, n, e;
|
||||
+
|
||||
+ herestr = expand_string_to_string (redirectee->word, 0);
|
||||
+- herelen = strlen (herestr);
|
||||
++ herelen = (herestr == NULL) ? 0 : strlen (herestr);
|
||||
+
|
||||
+ n = write (fd, herestr, herelen);
|
||||
+ if (n == herelen)
|
||||
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
PORTNAME= bash
|
||||
PORTVERSION= 2.05b.007
|
||||
PORTREVISION?= 0
|
||||
PORTREVISION?= 1
|
||||
CATEGORIES= shells
|
||||
MASTER_SITES= ${MASTER_SITE_GNU} \
|
||||
ftp://ftp.cwru.edu/pub/bash/
|
||||
|
|
20
shells/bash2/files/patch-redir.c
Normal file
20
shells/bash2/files/patch-redir.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
Index: files/patch-redir.c
|
||||
===================================================================
|
||||
RCS file: files/patch-redir.c
|
||||
diff -N files/patch-redir.c
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ files/patch-redir.c 20 Jun 2004 15:40:43 -0000
|
||||
@@ -0,0 +1,11 @@
|
||||
+--- redir.c.orig Sun Jun 20 18:00:47 2004
|
||||
++++ redir.c Sun Jun 20 18:01:25 2004
|
||||
+@@ -263,7 +263,7 @@
|
||||
+ int herelen, n, e;
|
||||
+
|
||||
+ herestr = expand_string_to_string (redirectee->word, 0);
|
||||
+- herelen = strlen (herestr);
|
||||
++ herelen = (herestr == NULL) ? 0 : strlen (herestr);
|
||||
+
|
||||
+ n = write (fd, herestr, herelen);
|
||||
+ if (n == herelen)
|
||||
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
PORTNAME= bash
|
||||
PORTVERSION= 2.05b.007
|
||||
PORTREVISION?= 0
|
||||
PORTREVISION?= 1
|
||||
CATEGORIES= shells
|
||||
MASTER_SITES= ${MASTER_SITE_GNU} \
|
||||
ftp://ftp.cwru.edu/pub/bash/
|
||||
|
|
20
shells/bash3/files/patch-redir.c
Normal file
20
shells/bash3/files/patch-redir.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
Index: files/patch-redir.c
|
||||
===================================================================
|
||||
RCS file: files/patch-redir.c
|
||||
diff -N files/patch-redir.c
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ files/patch-redir.c 20 Jun 2004 15:40:43 -0000
|
||||
@@ -0,0 +1,11 @@
|
||||
+--- redir.c.orig Sun Jun 20 18:00:47 2004
|
||||
++++ redir.c Sun Jun 20 18:01:25 2004
|
||||
+@@ -263,7 +263,7 @@
|
||||
+ int herelen, n, e;
|
||||
+
|
||||
+ herestr = expand_string_to_string (redirectee->word, 0);
|
||||
+- herelen = strlen (herestr);
|
||||
++ herelen = (herestr == NULL) ? 0 : strlen (herestr);
|
||||
+
|
||||
+ n = write (fd, herestr, herelen);
|
||||
+ if (n == herelen)
|
||||
|
||||
|
Loading…
Reference in a new issue