From 8e86c4888aca6a08bb5b8080950f7b9772d72cdb Mon Sep 17 00:00:00 2001 From: eivind Date: Wed, 8 Oct 1997 12:10:33 +0000 Subject: Slightly improved fix compared to my insiration don't munge argv strings -- copy them first. avoids 'w' showing: deraadt p8 zeus.theos.com 8:26AM 3 dd if of bs Obtained from: OpenBSD (file rev 1.3) by Theo de Raadt --- bin/dd/args.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin/dd/args.c') diff --git a/bin/dd/args.c b/bin/dd/args.c index 1f4d774..c5a14f7 100644 --- a/bin/dd/args.c +++ b/bin/dd/args.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: args.c,v 1.8 1997/02/22 14:02:41 peter Exp $ */ #ifndef lint @@ -101,6 +101,8 @@ jcl(argv) in.dbsz = out.dbsz = 512; while ((oper = *++argv) != NULL) { + if ((oper = strdup(oper)) == NULL) + errx(1, "unable to allocate space for the argument \"%s\"", *argv); if ((arg = strchr(oper, '=')) == NULL) errx(1, "unknown operand %s", oper); *arg++ = '\0'; -- cgit v1.1