projects
/
reactos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ecfcc1
)
[PSDK]
author
Thomas Faber
<thomas.faber@reactos.org>
Thu, 14 Nov 2013 21:44:47 +0000
(21:44 +0000)
committer
Thomas Faber
<thomas.faber@reactos.org>
Thu, 14 Nov 2013 21:44:47 +0000
(21:44 +0000)
- Fix (nt)intsafe.h signed to unsigned conversions. Based on a patch by Timo.
CORE-7578 #resolve
svn path=/trunk/; revision=60993
reactos/include/psdk/intsafe.h
patch
|
blob
|
history
diff --git
a/reactos/include/psdk/intsafe.h
b/reactos/include/psdk/intsafe.h
index
b5b2533
..
9654b5f
100644
(file)
--- a/
reactos/include/psdk/intsafe.h
+++ b/
reactos/include/psdk/intsafe.h
@@
-343,7
+343,8
@@
INTSAFE_NAME(_Name)( \
_In_ _TypeFrom Input, \
_Out_ _Deref_out_range_(==, Input) _TypeTo *pOutput) \
{ \
- if ((Input >= 0) && ((_TypeTo)Input <= _TypeTo ## _MAX)) \
+ if ((Input >= 0) && \
+ ((sizeof(_TypeFrom) <= sizeof(_TypeTo)) || (Input <= (_TypeFrom)_TypeTo ## _MAX))) \
{ \
*pOutput = (_TypeTo)Input; \
return INTSAFE_SUCCESS; \