From 6baeceae1cdcd80e73236454d3fda47f1fc78477 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Wed, 13 Apr 2005 15:43:36 +0000 Subject: [PATCH] Don't write to tape, strdup it first. Submitted-by: Sepherosa Ziehau --- sbin/dump/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sbin/dump/main.c b/sbin/dump/main.c index 259264dd7c..636be16265 100644 --- a/sbin/dump/main.c +++ b/sbin/dump/main.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)main.c 8.6 (Berkeley) 5/1/95 * $FreeBSD: src/sbin/dump/main.c,v 1.20.2.9 2003/01/25 18:54:59 dillon Exp $ - * $DragonFly: src/sbin/dump/main.c,v 1.10 2005/04/13 15:21:36 joerg Exp $ + * $DragonFly: src/sbin/dump/main.c,v 1.11 2005/04/13 15:43:36 joerg Exp $ */ #include @@ -253,7 +253,8 @@ main(int argc, char **argv) } if (strchr(tape, ':')) { - host = tape; + if ((host = strdup(tape)) == NULL) + err(1, "strdup failed"); tape = strchr(host, ':'); *tape++ = '\0'; #ifdef RDUMP -- 2.41.0