[Piglit] [PATCH] gl-3.0-bound-resource-limits: Fix potential strncat overflow.

Vinson Lee vlee at freedesktop.org
Mon Jan 19 13:23:52 PST 2015


Fix out-of-bounds access defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/spec/gl-3.0/bound-resource-limits.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/gl-3.0/bound-resource-limits.c b/tests/spec/gl-3.0/bound-resource-limits.c
index 1e5cf41..64533a0 100644
--- a/tests/spec/gl-3.0/bound-resource-limits.c
+++ b/tests/spec/gl-3.0/bound-resource-limits.c
@@ -595,7 +595,7 @@ build_reduce_glsl_shader(const PackedDesc *packedInput,
                 return false;
         }
 
-        shaderTextFree = MAX_SHADER_TEXT_CHARS;
+        shaderTextFree = MAX_SHADER_TEXT_CHARS - 1;
 
         snprintf(shaderTempText[0], MAX_SHADER_LINE_CHARS,
         "%s\n", GLSL_VERSION);
-- 
2.2.1



More information about the Piglit mailing list