From edd5ce97c3f39f3855e9b829df59500667c4682d Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Sun, 20 Jun 2004 22:37:22 +0000 Subject: Avoid a null pointer dereference, so 'xargs <<< ${EMTPY_VARIABLE}' will not segfault and dump core. Submitted by: Robert Nagy --- shells/bash3/Makefile | 2 +- shells/bash3/files/patch-redir.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 shells/bash3/files/patch-redir.c (limited to 'shells/bash3') diff --git a/shells/bash3/Makefile b/shells/bash3/Makefile index b3066ea38177..e4a986b630ef 100644 --- a/shells/bash3/Makefile +++ b/shells/bash3/Makefile @@ -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/ diff --git a/shells/bash3/files/patch-redir.c b/shells/bash3/files/patch-redir.c new file mode 100644 index 000000000000..ea8c49cb57a0 --- /dev/null +++ b/shells/bash3/files/patch-redir.c @@ -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) + + -- cgit v1.2.3