add a patch that fix crash when a invalid device is received in rdpdr_process_irp.

patch from upstream
http://sourceforge.net/p/rdesktop/code/1701/
This commit is contained in:
gsoares 2013-07-04 15:12:34 +00:00
parent 7c716265c8
commit 792d1ac0fd
2 changed files with 26 additions and 1 deletions

View File

@ -1,7 +1,8 @@
# $OpenBSD: Makefile,v 1.38 2013/03/11 11:46:15 espie Exp $
# $OpenBSD: Makefile,v 1.39 2013/07/04 15:12:34 gsoares Exp $
COMMENT= open source client for Windows Terminal Server
DISTNAME= rdesktop-1.7.1
REVISION= 1
CATEGORIES= x11 net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=rdesktop/}

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-rdpdr_c,v 1.1 2013/07/04 15:12:34 gsoares Exp $
Fix crash when a invalid device is received in rdpdr_process_irp.
patch from upstream
http://sourceforge.net/p/rdesktop/code/1701/
--- rdpdr.c.orig Wed Apr 13 08:13:04 2011
+++ rdpdr.c Tue Jun 18 20:51:34 2013
@@ -379,6 +379,15 @@ rdpdr_process_irp(STREAM s)
buffer = (uint8 *) xmalloc(1024);
buffer[0] = 0;
+ if(device >= RDPDR_MAX_DEVICES)
+ {
+ error("%s invalid device 0x%lx file 0x%lx id 0x%lx "
+ "major 0x%lx minor 0x%lx\n", device, file, id,
+ major, minor);
+ if (buffer)
+ xfree(buffer);
+ return;
+ }
switch (g_rdpdr_device[device].device_type)
{
case DEVICE_TYPE_SERIAL: