mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-common: Explicitly limit value to UINT_MAX in vkd3d_env_var_as_uint().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
abdaa20376
commit
18f8019fd9
@ -22,6 +22,7 @@
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -310,7 +311,7 @@ unsigned int vkd3d_env_var_as_uint(const char *name, unsigned int default_value)
|
||||
errno = 0;
|
||||
r = strtoul(value, &end_ptr, 0);
|
||||
if (!errno && end_ptr != value)
|
||||
return r;
|
||||
return min(r, UINT_MAX);
|
||||
}
|
||||
|
||||
return default_value;
|
||||
|
Loading…
Reference in New Issue
Block a user