Skip to content

Commit

Permalink
OSInfo: fix implicit size_t conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrautz committed Aug 21, 2016
1 parent 1603d08 commit 51d333e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/OSInfo.cpp
Expand Up @@ -34,7 +34,10 @@ static QString regString(wchar_t *string, int size) {
// that the NUL is not included in the returned
// string.
const size_t adjustedSize = wcsnlen(string, static_cast<size_t>(size));
return QString::fromWCharArray(string, adjustedSize);
if (adjustedSize > INT_MAX) {
return QString();
}
return QString::fromWCharArray(string, static_cast<int>(adjustedSize));
}

/// Query for a Windows 10-style displayable version.
Expand Down

0 comments on commit 51d333e

Please sign in to comment.