summaryrefslogtreecommitdiffstats
path: root/bin/dd
diff options
context:
space:
mode:
authoreivind <eivind@FreeBSD.org>1997-10-08 12:10:33 +0000
committereivind <eivind@FreeBSD.org>1997-10-08 12:10:33 +0000
commit8e86c4888aca6a08bb5b8080950f7b9772d72cdb (patch)
treef82c454665fa3fa235a8b08a4fcc036b66fc7876 /bin/dd
parent070a7797856567ad3371d496590fb400597a5f38 (diff)
downloadFreeBSD-src-8e86c4888aca6a08bb5b8080950f7b9772d72cdb.zip
FreeBSD-src-8e86c4888aca6a08bb5b8080950f7b9772d72cdb.tar.gz
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 <deraadt@openbsd.org>
Diffstat (limited to 'bin/dd')
-rw-r--r--bin/dd/args.c4
1 files changed, 3 insertions, 1 deletions
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';
OpenPOWER on IntegriCloud