[Piglit] [PATCH] glx-string-sanity: Fix string length miscalculation.

Vinson Lee vlee at freedesktop.org
Sat Dec 1 10:57:57 PST 2012


Reported by Coverity Scan.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/glx/glx-string-sanity.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/glx/glx-string-sanity.c b/tests/glx/glx-string-sanity.c
index bc66665..1711d23 100644
--- a/tests/glx/glx-string-sanity.c
+++ b/tests/glx/glx-string-sanity.c
@@ -135,7 +135,7 @@ main(int argc, char **argv)
 	 * valid for a string to not be in the server string when it is listed
 	 * in the unified string.
 	 */
-	buf = malloc(strlen(server_string + 1));
+	buf = malloc(strlen(server_string) + 1);
 	while (*server_string != '\0') {
 		const char *client;
 		const char *end;
-- 
1.7.10.4



More information about the Piglit mailing list