diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-05-14 09:58:28 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-05-14 09:58:28 +0000 |
commit | 4a799d6586061e587b055de5cab167204d488b50 (patch) | |
tree | c1407d4cc6854f5070229059451c85ef24ecca43 | |
parent | 39fc8dc6e08faa4f43c53ae7583495a39361f008 (diff) |
better buf oflow protection
-rw-r--r-- | games/dm/dm.c | 4 | ||||
-rw-r--r-- | lib/libcurses/lib_mvcur.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/games/dm/dm.c b/games/dm/dm.c index 261e20fdcaf..9662e5228f5 100644 --- a/games/dm/dm.c +++ b/games/dm/dm.c @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)dm.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: dm.c,v 1.6 1998/05/14 09:51:37 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: dm.c,v 1.7 1998/05/14 09:58:27 deraadt Exp $"; #endif #endif /* not lint */ @@ -122,7 +122,7 @@ play(args) read_config() { FILE *cfp; - char lbuf[BUFSIZ], f1[40], f2[40], f3[40], f4[40], f5[40]; + char lbuf[BUFSIZ], f1[41], f2[41], f3[41], f4[41], f5[41]; if (!(cfp = fopen(_PATH_CONFIG, "r"))) return; diff --git a/lib/libcurses/lib_mvcur.c b/lib/libcurses/lib_mvcur.c index 8979d65b4ed..7fdee4eccfe 100644 --- a/lib/libcurses/lib_mvcur.c +++ b/lib/libcurses/lib_mvcur.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_mvcur.c,v 1.7 1998/05/14 09:48:49 deraadt Exp $ */ +/* $OpenBSD: lib_mvcur.c,v 1.8 1998/05/14 09:58:18 deraadt Exp $ */ /*************************************************************************** @@ -971,8 +971,8 @@ int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) char buf[BUFSIZ], capname[BUFSIZ]; char tparsebuf[20], tparsebuf[20]; - snprintf(tparsebuf, sizeof tparsebuf, "l %%%ds", sizeof tname); - snprintf(cparsebuf, sizeof cparsebuf, "d %%%ds", sizeof capname); + snprintf(tparsebuf, sizeof tparsebuf, "l %%%ds", sizeof tname-1); + snprintf(cparsebuf, sizeof cparsebuf, "d %%%ds", sizeof capname-1); (void) fputs("> ", stdout); (void) fgets(buf, sizeof(buf), stdin); |