summaryrefslogtreecommitdiff
path: root/lib/libcurses
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2020-07-14 13:37:18 +0000
committermartin <martin@NetBSD.org>2020-07-14 13:37:18 +0000
commitf361d80c9ee3c6c14ae16c978a878fa8ca4fcf4c (patch)
tree4bf7ce3693e18dbbf08a203e47439f39febe572d /lib/libcurses
parentbcb56518bc78a67f1adb3418380e7617c1b15418 (diff)
Pull up following revision(s) (requested by uwe in ticket #1004):
lib/libcurses/newwin.c: revision 1.58 newwin - fix crash with negative ncols. When support for negative nrows/ncols was added, one s/ncols/maxx/ was missed so we ended up passing negative (i.e. huge unsigned) length when hashing the line contents. Reported by Naman Jain in PR lib/55484
Diffstat (limited to 'lib/libcurses')
-rw-r--r--lib/libcurses/newwin.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libcurses/newwin.c b/lib/libcurses/newwin.c
index d46a29bda0c..11f92cf5037 100644
--- a/lib/libcurses/newwin.c
+++ b/lib/libcurses/newwin.c
@@ -1,4 +1,4 @@
-/* $NetBSD: newwin.c,v 1.57 2019/06/09 07:40:14 blymn Exp $ */
+/* $NetBSD: newwin.c,v 1.57.2.1 2020/07/14 13:37:18 martin Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)newwin.c 8.3 (Berkeley) 7/27/94";
#else
-__RCSID("$NetBSD: newwin.c,v 1.57 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: newwin.c,v 1.57.2.1 2020/07/14 13:37:18 martin Exp $");
#endif
#endif /* not lint */
@@ -174,7 +174,7 @@ __newwin(SCREEN *screen, int nlines, int ncols, int by, int bx, int ispad,
#endif /* HAVE_WCHAR */
}
lp->hash = __hash((char *)(void *)lp->line,
- (size_t)(ncols * __LDATASIZE));
+ (size_t)(maxx * __LDATASIZE));
}
return (win);
}