From 789ddb290ea1dc52c2819c17198bd0199b70aaaf Mon Sep 17 00:00:00 2001 From: naddy Date: Thu, 8 Apr 2004 00:13:43 +0000 Subject: [PATCH] don't dereference null pointer; from Gentoo via Robert Nagy --- shells/bash2/patches/patch-redir_c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 shells/bash2/patches/patch-redir_c diff --git a/shells/bash2/patches/patch-redir_c b/shells/bash2/patches/patch-redir_c new file mode 100644 index 00000000000..95dca9a650d --- /dev/null +++ b/shells/bash2/patches/patch-redir_c @@ -0,0 +1,12 @@ +$OpenBSD: patch-redir_c,v 1.1 2004/04/08 00:13:43 naddy Exp $ +--- redir.c.orig 2004-04-08 02:04:50.000000000 +0200 ++++ redir.c 2004-04-08 02:05:09.000000000 +0200 +@@ -263,7 +263,7 @@ write_here_string (fd, redirectee) + 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)