diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-10-01 06:32:45 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-10-01 06:32:45 +0000 |
commit | 74c70da742dcb7a7a5cfc5b369dc07ecb2e38fa6 (patch) | |
tree | 7df047b41df9a26a9135ae931dfe53e4c51edb4f /usr.bin/talk | |
parent | f08a50a4ce4808268ccfd6fa88868baba967aa8c (diff) |
handle failed strdup; reported by jjy2+@pitt.edu
Diffstat (limited to 'usr.bin/talk')
-rw-r--r-- | usr.bin/talk/get_names.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/talk/get_names.c b/usr.bin/talk/get_names.c index 56be44c5c6f..944a7f606c7 100644 --- a/usr.bin/talk/get_names.c +++ b/usr.bin/talk/get_names.c @@ -1,4 +1,4 @@ -/* $OpenBSD: get_names.c,v 1.13 2003/07/10 00:06:51 david Exp $ */ +/* $OpenBSD: get_names.c,v 1.14 2003/10/01 06:32:44 deraadt Exp $ */ /* $NetBSD: get_names.c,v 1.4 1994/12/09 02:14:16 jtc Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)get_names.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: get_names.c,v 1.13 2003/07/10 00:06:51 david Exp $"; +static char rcsid[] = "$OpenBSD: get_names.c,v 1.14 2003/10/01 06:32:44 deraadt Exp $"; #endif /* not lint */ #include "talk.h" @@ -93,6 +93,8 @@ get_names(argc, argv) my_machine_name = hostname; /* check for, and strip out, the machine name of the target */ names = strdup(argv[1]); + if (names == NULL) + errx(1, "out of memory"); for (cp = names; *cp && !strchr("@:!.", *cp); cp++) ; if (*cp == '\0') { |