[Piglit] [PATCH] util: Ensure endptr is initialized.

Vinson Lee vlee at freedesktop.org
Thu Dec 6 22:20:28 PST 2012


Fixes uninititalized pointer read defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/util/piglit-vbo.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/util/piglit-vbo.cpp b/tests/util/piglit-vbo.cpp
index 9749934..6ea4b1a 100644
--- a/tests/util/piglit-vbo.cpp
+++ b/tests/util/piglit-vbo.cpp
@@ -265,6 +265,10 @@ vertex_attrib_description::parse_datum(const char **text, void *data) const
 		*((GLuint *) data) = (GLuint) value;
 		break;
 	}
+	default:
+		assert(0);
+		endptr = NULL;
+		break;
 	}
 	*text = endptr;
 	return true;
-- 
1.8.0.1



More information about the Piglit mailing list