[PATCH 0/1] MR11683: ntdll: Avoid sign extension when parsing MaxVersionTested (cppcheck)
Testing with a simple program and a manifest containing `<maxversiontested Id="10.0.35000.0"/>`... Wine: `MaxVersionTested: 0xffffffff88b80000` Windows 10: `MaxVersionTested: 0xa000088b80000` Wine after patch: `MaxVersionTested: 0xa000088b80000` Windows build numbers haven't exceeded 32768 yet, but they could one day. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11683
From: Ken Sharp <sharp_ken@hotmail.com> --- dlls/ntdll/actctx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index 47464d40b37..03a4dfc6d0e 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -2439,8 +2439,10 @@ static void parse_maxversiontested_elem( xmlbuf_t *xmlbuf, struct assembly *asse } parse_version( &attr.value, &version ); compat->Type = ACTCTX_COMPATIBILITY_ELEMENT_TYPE_MAXVERSIONTESTED; - compat->MaxVersionTested = (ULONGLONG)version.major << 48 | - (ULONGLONG)version.minor << 32 | version.build << 16 | version.revision; + compat->MaxVersionTested = ((ULONGLONG)version.major << 48) | + ((ULONGLONG)version.minor << 32) | + ((ULONGLONG)version.build << 16) | + (ULONGLONG)version.revision; } else if (!is_xmlns_attr( &attr )) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11683
This merge request was approved by Jinoh Kang. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11683
participants (3)
-
Jinoh Kang (@iamahuman) -
Ken Sharp -
Ken Sharp (@imwellcushtymelike)