Author: hbelusca
Date: Tue Jan 31 20:48:41 2017
New Revision: 73648
URL:
http://svn.reactos.org/svn/reactos?rev=73648&view=rev
Log:
Port the following trunk fixes:
[FRAMEDYN]: Fix integer overflow checks. CID 1101981, 1248380, 1248381 (r73633).
[PSDK]: Remove incorrect bit masking from IsRecognizedPartition &
IsContainerPartition. CID 1341188 (r73634).
[DHCPCSVC]: Addendum to r69652: Avoid some more "Operands don't affect
result" warnings. CID 515151, 515152, 515153 (r73635).
[FREELDR]: Correctly check for vertical retrace in PcVideoSync. CID 513066 (r73636).
[MSPAINT]: Add missing break in CMainWindow::OnCommand/IDM_FORMATICONBAR. CID 1322024
(r73642).
[BOOTLIB]: Correctly check for floppy devices in BlockIoEfiGetDeviceInformation. CID
1341189 (r73643).
Modified:
branches/ReactOS-0.4.4-FOSDEM2017/reactos/ (props changed)
branches/ReactOS-0.4.4-FOSDEM2017/reactos/base/applications/mspaint/winproc.cpp
branches/ReactOS-0.4.4-FOSDEM2017/reactos/base/services/dhcpcsvc/include/debug.h
branches/ReactOS-0.4.4-FOSDEM2017/reactos/boot/environ/lib/io/device.c
branches/ReactOS-0.4.4-FOSDEM2017/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c
branches/ReactOS-0.4.4-FOSDEM2017/reactos/dll/win32/framedyn/chstring.cpp
branches/ReactOS-0.4.4-FOSDEM2017/reactos/sdk/include/psdk/winioctl.h
Propchange: branches/ReactOS-0.4.4-FOSDEM2017/reactos/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 31 20:48:41 2017
@@ -23,4 +23,4 @@
/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
/branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567
/branches/wlan-bringup:54809-54998
-/trunk/reactos:73522-73601
+/trunk/reactos:73522-73601,73633-73636,73642-73643
Modified: branches/ReactOS-0.4.4-FOSDEM2017/reactos/base/applications/mspaint/winproc.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-FOSDEM2017/reacto…
==============================================================================
---
branches/ReactOS-0.4.4-FOSDEM2017/reactos/base/applications/mspaint/winproc.cpp [iso-8859-1]
(original)
+++
branches/ReactOS-0.4.4-FOSDEM2017/reactos/base/applications/mspaint/winproc.cpp [iso-8859-1]
Tue Jan 31 20:48:41 2017
@@ -645,7 +645,7 @@
break;
case IDM_FORMATICONBAR:
textEditWindow.ShowWindow(textEditWindow.IsWindowVisible() ? SW_HIDE :
SW_SHOW);
-
+ break;
case IDM_VIEWSHOWGRID:
showGrid = !showGrid;
imageArea.Invalidate(FALSE);
Modified:
branches/ReactOS-0.4.4-FOSDEM2017/reactos/base/services/dhcpcsvc/include/debug.h
URL:
http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-FOSDEM2017/reacto…
==============================================================================
---
branches/ReactOS-0.4.4-FOSDEM2017/reactos/base/services/dhcpcsvc/include/debug.h [iso-8859-1]
(original)
+++
branches/ReactOS-0.4.4-FOSDEM2017/reactos/base/services/dhcpcsvc/include/debug.h [iso-8859-1]
Tue Jan 31 20:48:41 2017
@@ -25,8 +25,9 @@
#ifdef _MSC_VER
#define DH_DbgPrint(_t_, _x_) \
- if (((debug_trace_level & NORMAL_MASK) >= _t_) || \
- ((debug_trace_level & _t_) > NORMAL_MASK)) { \
+ if ((_t_ > NORMAL_MASK) \
+ ? (debug_trace_level & _t_) > NORMAL_MASK \
+ : (debug_trace_level & NORMAL_MASK) >= _t_) { \
DbgPrint("(%s:%d) ", __FILE__, __LINE__); \
DbgPrint _x_ ; \
}
@@ -34,8 +35,9 @@
#else /* _MSC_VER */
#define DH_DbgPrint(_t_, _x_) \
- if (((debug_trace_level & NORMAL_MASK) >= _t_) || \
- ((debug_trace_level & _t_) > NORMAL_MASK)) { \
+ if ((_t_ > NORMAL_MASK) \
+ ? (debug_trace_level & _t_) > NORMAL_MASK \
+ : (debug_trace_level & NORMAL_MASK) >= _t_) { \
DbgPrint("(%s:%d)(%s) ", __FILE__, __LINE__, __FUNCTION__); \
DbgPrint _x_ ; \
}
Modified: branches/ReactOS-0.4.4-FOSDEM2017/reactos/boot/environ/lib/io/device.c
URL:
http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-FOSDEM2017/reacto…
==============================================================================
--- branches/ReactOS-0.4.4-FOSDEM2017/reactos/boot/environ/lib/io/device.c [iso-8859-1]
(original)
+++ branches/ReactOS-0.4.4-FOSDEM2017/reactos/boot/environ/lib/io/device.c [iso-8859-1]
Tue Jan 31 20:48:41 2017
@@ -1012,7 +1012,7 @@
{
/* We only support floppy drives */
AcpiPath = (ACPI_HID_DEVICE_PATH*)LeafNode;
- if ((AcpiPath->HID == EISA_PNP_ID(0x604)) &&
+ if ((AcpiPath->HID == EISA_PNP_ID(0x604)) ||
(AcpiPath->HID == EISA_PNP_ID(0x700)))
{
/* Set the boot library specific device types */
Modified:
branches/ReactOS-0.4.4-FOSDEM2017/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c
URL:
http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-FOSDEM2017/reacto…
==============================================================================
---
branches/ReactOS-0.4.4-FOSDEM2017/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c [iso-8859-1]
(original)
+++
branches/ReactOS-0.4.4-FOSDEM2017/reactos/boot/freeldr/freeldr/arch/i386/pcvideo.c [iso-8859-1]
Tue Jan 31 20:48:41 2017
@@ -1089,7 +1089,7 @@
VOID
PcVideoSync(VOID)
{
- while (1 == (READ_PORT_UCHAR((UCHAR*)VIDEOPORT_VERTICAL_RETRACE) & 0x08))
+ while ((READ_PORT_UCHAR((UCHAR*)VIDEOPORT_VERTICAL_RETRACE) & 0x08))
{
/*
* Keep reading the port until bit 3 is clear
@@ -1099,7 +1099,7 @@
*/
}
- while (0 == (READ_PORT_UCHAR((UCHAR*)VIDEOPORT_VERTICAL_RETRACE) & 0x08))
+ while (!(READ_PORT_UCHAR((UCHAR*)VIDEOPORT_VERTICAL_RETRACE) & 0x08))
{
/*
* Keep reading the port until bit 3 is set
Modified: branches/ReactOS-0.4.4-FOSDEM2017/reactos/dll/win32/framedyn/chstring.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-FOSDEM2017/reacto…
==============================================================================
--- branches/ReactOS-0.4.4-FOSDEM2017/reactos/dll/win32/framedyn/chstring.cpp [iso-8859-1]
(original)
+++ branches/ReactOS-0.4.4-FOSDEM2017/reactos/dll/win32/framedyn/chstring.cpp [iso-8859-1]
Tue Jan 31 20:48:41 2017
@@ -288,7 +288,7 @@
}
// Nor too big
- if (nSize > INT_MAX)
+ if (nSize > (INT_MAX - (int)sizeof(CHStringData)) / (int)sizeof(WCHAR))
{
RaiseException(STATUS_INTEGER_OVERFLOW, EXCEPTION_NONCONTINUABLE, 0, 0);
}
@@ -442,7 +442,7 @@
}
// Ensure we wouldn't overflow with the concat
- if (GetData()->nDataLength + nSrcLen > INT_MAX)
+ if (GetData()->nDataLength > INT_MAX - nSrcLen)
{
RaiseException(STATUS_INTEGER_OVERFLOW, EXCEPTION_NONCONTINUABLE, 0, 0);
}
@@ -461,7 +461,7 @@
else
{
// Ensure we don't overflow
- if (nSrcLen > INT_MAX)
+ if (nSrcLen > INT_MAX - GetData()->nDataLength)
{
RaiseException(STATUS_INTEGER_OVERFLOW, EXCEPTION_NONCONTINUABLE, 0, 0);
}
Modified: branches/ReactOS-0.4.4-FOSDEM2017/reactos/sdk/include/psdk/winioctl.h
URL:
http://svn.reactos.org/svn/reactos/branches/ReactOS-0.4.4-FOSDEM2017/reacto…
==============================================================================
--- branches/ReactOS-0.4.4-FOSDEM2017/reactos/sdk/include/psdk/winioctl.h [iso-8859-1]
(original)
+++ branches/ReactOS-0.4.4-FOSDEM2017/reactos/sdk/include/psdk/winioctl.h [iso-8859-1] Tue
Jan 31 20:48:41 2017
@@ -592,18 +592,18 @@
((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32))||\
((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32_XINT13))||\
((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13))||\
- ((t&~PARTITION_NTFT)==PARTITION_FAT_12)||\
- ((t&~PARTITION_NTFT)==PARTITION_FAT_16)||\
- ((t&~PARTITION_NTFT)==PARTITION_IFS)||\
- ((t&~PARTITION_NTFT)==PARTITION_HUGE)||\
- ((t&~PARTITION_NTFT)==PARTITION_FAT32)||\
- ((t&~PARTITION_NTFT)==PARTITION_FAT32_XINT13)||\
- ((t&~PARTITION_NTFT)==PARTITION_XINT13)||\
- ((t&~PARTITION_NTFT)==PARTITION_LINUX)||\
- ((t&~PARTITION_NTFT)==PARTITION_OLD_LINUX)||\
- ((t&~PARTITION_NTFT)==PARTITION_FREEBSD)||\
- ((t&~PARTITION_NTFT)==PARTITION_OPENBSD)||\
- ((t&~PARTITION_NTFT)==PARTITION_NETBSD))
+ ((t)==PARTITION_FAT_12)||\
+ ((t)==PARTITION_FAT_16)||\
+ ((t)==PARTITION_IFS)||\
+ ((t)==PARTITION_HUGE)||\
+ ((t)==PARTITION_FAT32)||\
+ ((t)==PARTITION_FAT32_XINT13)||\
+ ((t)==PARTITION_XINT13)||\
+ ((t)==PARTITION_LINUX)||\
+ ((t)==PARTITION_OLD_LINUX)||\
+ ((t)==PARTITION_FREEBSD)||\
+ ((t)==PARTITION_OPENBSD)||\
+ ((t)==PARTITION_NETBSD))
#else
#define IsRecognizedPartition(t)\
(((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT_12))||\
@@ -613,19 +613,19 @@
((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32))||\
((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_FAT32_XINT13))||\
((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13))||\
- ((t&~PARTITION_NTFT)==PARTITION_FAT_12)||\
- ((t&~PARTITION_NTFT)==PARTITION_FAT_16)||\
- ((t&~PARTITION_NTFT)==PARTITION_IFS)||\
- ((t&~PARTITION_NTFT)==PARTITION_HUGE)||\
- ((t&~PARTITION_NTFT)==PARTITION_FAT32)||\
- ((t&~PARTITION_NTFT)==PARTITION_FAT32_XINT13)||\
- ((t&~PARTITION_NTFT)==PARTITION_XINT13))
+ ((t)==PARTITION_FAT_12)||\
+ ((t)==PARTITION_FAT_16)||\
+ ((t)==PARTITION_IFS)||\
+ ((t)==PARTITION_HUGE)||\
+ ((t)==PARTITION_FAT32)||\
+ ((t)==PARTITION_FAT32_XINT13)||\
+ ((t)==PARTITION_XINT13))
#endif
#define IsContainerPartition(t)\
(((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_EXTENDED))||\
((t&PARTITION_NTFT)&&((t&~VALID_NTFT)==PARTITION_XINT13_EXTENDED))||\
- ((t&~PARTITION_NTFT)==PARTITION_EXTENDED)||\
- ((t&~PARTITION_NTFT)==PARTITION_XINT13_EXTENDED))
+ ((t)==PARTITION_EXTENDED)||\
+ ((t)==PARTITION_XINT13_EXTENDED))
#ifdef _MSC_VER
#pragma warning(pop)