diff options
author | 2008-04-24 19:13:56 +0000 | |
---|---|---|
committer | 2008-04-24 19:13:56 +0000 | |
commit | 9a0ecc805409c64f5c1701cf80c69a31d92c3ca0 (patch) | |
tree | 8306a1b8cca170cc94f898af046a2b8daa5e8732 | |
parent | kill first person (diff) | |
download | wireguard-openbsd-9a0ecc805409c64f5c1701cf80c69a31d92c3ca0.tar.xz wireguard-openbsd-9a0ecc805409c64f5c1701cf80c69a31d92c3ca0.zip |
Use a fixed string in case of vasprintf() error instead of relying on
strerror(). Although our vasprintf() sets errno, we cannot rely on it on
other systems.
ok ray (who spotted this issue), xsa
-rw-r--r-- | usr.bin/cvs/client.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/diff_internals.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/log.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/server.c | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/cvs/client.c b/usr.bin/cvs/client.c index 32e21bed1f6..5be27bd7aaf 100644 --- a/usr.bin/cvs/client.c +++ b/usr.bin/cvs/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.112 2008/04/18 20:26:07 tobias Exp $ */ +/* $OpenBSD: client.c,v 1.113 2008/04/24 19:13:56 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -322,7 +322,7 @@ cvs_client_send_request(char *fmt, ...) i = vasprintf(&data, fmt, ap); va_end(ap); if (i == -1) - fatal("cvs_client_send_request: %s", strerror(errno)); + fatal("cvs_client_send_request: could not allocate memory"); if ((s = strchr(data, ' ')) != NULL) *s = '\0'; diff --git a/usr.bin/cvs/diff_internals.c b/usr.bin/cvs/diff_internals.c index 2c022d7d9f5..ff0a264d3df 100644 --- a/usr.bin/cvs/diff_internals.c +++ b/usr.bin/cvs/diff_internals.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff_internals.c,v 1.20 2008/03/08 11:53:36 joris Exp $ */ +/* $OpenBSD: diff_internals.c,v 1.21 2008/04/24 19:13:56 tobias Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -1454,7 +1454,7 @@ diff_output(const char *fmt, ...) i = vasprintf(&str, fmt, vap); va_end(vap); if (i == -1) - fatal("diff_output: %s", strerror(errno)); + fatal("diff_output: could not allocate memory"); if (diffbuf != NULL) cvs_buf_append(diffbuf, str, strlen(str)); else diff --git a/usr.bin/cvs/log.c b/usr.bin/cvs/log.c index 294c098d196..f83a06b50e6 100644 --- a/usr.bin/cvs/log.c +++ b/usr.bin/cvs/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.42 2008/01/10 10:05:40 tobias Exp $ */ +/* $OpenBSD: log.c,v 1.43 2008/04/24 19:13:56 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> @@ -131,7 +131,7 @@ cvs_printf(const char *fmt, ...) ret = vasprintf(&nstr, fmt, vap); if (ret == -1) - fatal("cvs_printf: %s", strerror(errno)); + fatal("cvs_printf: could not allocate memory"); for (dp = nstr; *dp != '\0';) { sp = strchr(dp, '\n'); if (sp == NULL) diff --git a/usr.bin/cvs/server.c b/usr.bin/cvs/server.c index 25c8ad35384..05a1d573be4 100644 --- a/usr.bin/cvs/server.c +++ b/usr.bin/cvs/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.85 2008/04/18 20:26:07 tobias Exp $ */ +/* $OpenBSD: server.c,v 1.86 2008/04/24 19:13:56 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -150,7 +150,7 @@ cvs_server_send_response(char *fmt, ...) i = vasprintf(&data, fmt, ap); va_end(ap); if (i == -1) - fatal("cvs_server_send_response: %s", strerror(errno)); + fatal("cvs_server_send_response: could not allocate memory"); cvs_log(LP_TRACE, "%s", data); cvs_remote_output(data); |