]> git.sesse.net Git - vlc/commitdiff
Check that integers are within range when loading vlcrc
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 11 Jul 2010 15:22:54 +0000 (18:22 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 11 Jul 2010 15:23:42 +0000 (18:23 +0300)
src/config/file.c

index 71a02df8e672d25313cdd224d13f7e8ebbc6db97..0582483146ffd1bc15187956ef2cf5bfe28832f3 100644 (file)
@@ -274,6 +274,8 @@ int config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
                 case CONFIG_ITEM_INTEGER:
                 {
                     int64_t l = strtoi (psz_option_value);
+                    if ((l > p_item->max.i) || (l < p_item->min.i))
+                        errno = ERANGE;
                     if (errno)
                         msg_Warn (p_this, "Integer value (%s) for %s: %m",
                                   psz_option_value, psz_option_name);