[waffle] [PATCH 1/2] wflinfo: Don't allow negative version numbers

Jordan Justen jordan.l.justen at intel.com
Tue Apr 29 08:39:18 PDT 2014


Previously, -V 4.-8 would be treated the same as -V 3.2.

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/utils/wflinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c
index 7e3dd48..386bdd0 100644
--- a/src/utils/wflinfo.c
+++ b/src/utils/wflinfo.c
@@ -332,7 +332,7 @@ parse_args(int argc, char *argv[], struct options *opts)
                 int match_count;
 
                 match_count = sscanf(optarg, "%d.%d", &major, &minor);
-                if (match_count != 2) {
+                if (match_count != 2 || major < 0 || minor < 0) {
                     usage_error_printf("'%s' is not a valid OpenGL version",
                                        optarg);
                 }
-- 
1.9.2



More information about the waffle mailing list