1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-04 01:48:54 +00:00
freebsd-ports/sysutils/screen/files/patch-ansi.c
Cy Schubert 15d50ff35c Fix buffer overflow that allows privilege escalation for local users.
Approved by:	will (using his portmgr hat)
Obtained from:	Timo Sirainen <tss@iki.fi> on BUGTRAQ
2003-12-02 23:36:47 +00:00

12 lines
415 B
C

--- ansi.c.orig Mon Sep 8 07:24:44 2003
+++ ansi.c Mon Dec 1 17:17:17 2003
@@ -559,7 +559,7 @@
{
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- if (curr->w_NumArgs < MAXARGS)
+ if (curr->w_NumArgs >= 0 && curr->w_NumArgs < MAXARGS)
{
if (curr->w_args[curr->w_NumArgs] < 100000000)
curr->w_args[curr->w_NumArgs] =