diff options
| author | 2016-09-01 14:12:07 +0000 | |
|---|---|---|
| committer | 2016-09-01 14:12:07 +0000 | |
| commit | 6c5fbaeafe124414fc088f3e66d519b416b83a00 (patch) | |
| tree | ae84084bcd04a7fc11b70ed6ea6ca7be5fa2d164 | |
| parent | Use b64_ntop instead of adding yet another base implementation of base64 (diff) | |
| download | wireguard-openbsd-6c5fbaeafe124414fc088f3e66d519b416b83a00.tar.xz wireguard-openbsd-6c5fbaeafe124414fc088f3e66d519b416b83a00.zip | |
make the version symbol a fixed size (512) to reduce the potential for
bad effects when savecore reads beyond it
ok deraadt (and thanks to bluhm for remembering that this happens)
| -rw-r--r-- | sbin/savecore/savecore.c | 8 | ||||
| -rw-r--r-- | sys/conf/newvers.sh | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 45cf7a0c490..a96c618c621 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -1,4 +1,4 @@ -/* $OpenBSD: savecore.c,v 1.56 2016/07/04 04:05:29 guenther Exp $ */ +/* $OpenBSD: savecore.c,v 1.57 2016/09/01 14:12:07 tedu Exp $ */ /* $NetBSD: savecore.c,v 1.26 1996/03/18 21:16:05 leo Exp $ */ /*- @@ -89,6 +89,8 @@ struct nlist dump_nl[] = { /* Name list for dumped system. */ { NULL }, }; +#define VERSIONSIZE 512 + /* Types match kernel declarations. */ long dumplo; /* where dump starts on dumpdev (in blocks) */ off_t dumpoff; /* where dump starts on dumpdev (in bytes) */ @@ -105,7 +107,7 @@ kvm_t *kd_dump; /* kvm descriptor on block dev */ time_t now; /* current date */ char panic_mesg[1024]; int panicstr; -char vers[1024]; +char vers[VERSIONSIZE]; int clear, zcompress, force, verbose; /* flags */ @@ -294,7 +296,7 @@ check_kmem(void) { char *cp; int panicloc; - char core_vers[1024]; + char core_vers[VERSIONSIZE]; if (kvm_read(kd_dump, dump_nl[X_VERSION].n_value, core_vers, sizeof(core_vers)) != sizeof(core_vers)) { diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index f9d92dad083..cc611827c68 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: newvers.sh,v 1.147 2016/07/26 17:57:14 kettenis Exp $ +# $OpenBSD: newvers.sh,v 1.148 2016/09/01 14:12:07 tedu Exp $ # $NetBSD: newvers.sh,v 1.17.2.1 1995/10/12 05:17:11 jtc Exp $ # # Copyright (c) 1984, 1986, 1990, 1993 @@ -77,7 +77,7 @@ const char osrelease[] = "${osr}"; const char osversion[] = "${id}#${v}"; const char sccs[] = " @(#)${ost} ${osr}" STATUS " (${id}) #${v}: ${t}\n"; -const char version[] = +const char version[512] = "${ost} ${osr}" STATUS " (${id}) #${v}: ${t}\n ${u}@${h}:${d}\n"; eof |
