[vlc-commits] commit: Check that integers are within range when loading vlcrc ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Sun Jul 11 17:23:46 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 11 18:22:54 2010 +0300| [d823d1842255dad93232205647ca6450db91ca9f] | committer: Rémi Denis-Courmont 

Check that integers are within range when loading vlcrc

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d823d1842255dad93232205647ca6450db91ca9f
---

 src/config/file.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/config/file.c b/src/config/file.c
index 71a02df..0582483 100644
--- a/src/config/file.c
+++ b/src/config/file.c
@@ -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);



More information about the vlc-commits mailing list