From 3362c7d9b61462855f1e7d67da5d255de1b6ee7e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 23 Apr 2012 17:12:04 -0700 Subject: mesa: Prevent buffer underrun when handling MESA_GL_EXTENSION_OVERRIDE. --- src/mesa/main/extensions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 5f2c74a758e..a843a40925c 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -754,7 +754,7 @@ get_extension_override( struct gl_context *ctx ) /* Remove trailing space. */ len = strlen(extra_exts); - if (extra_exts[len - 1] == ' ') + if (len > 0 && extra_exts[len - 1] == ' ') extra_exts[len - 1] = '\0'; return extra_exts; -- cgit v1.2.3