From 1494c8a45ed2c3c4cb0cf853232715eca87e1426 Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Tue, 30 Jan 2018 10:32:42 +0900 Subject: [PATCH] samples: Fixed to prevent buffer overflow problem. - OVERFLOW_UNDER_CHECK WGID: 305123, 305124 Change-Id: I6ed25955b9846bcdfdf86b35586594ff4f7b96e9 Signed-off-by: joonbum.ko --- samples/tri.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samples/tri.c b/samples/tri.c index dcbfd86..ec29647 100644 --- a/samples/tri.c +++ b/samples/tri.c @@ -1910,6 +1910,7 @@ static void demo_init_vk(struct demo *demo) { demo->extension_names[demo->enabled_extension_count++] = VK_KHR_SURFACE_EXTENSION_NAME; } + assert(demo->enabled_extension_count < 64); #ifdef _WIN32 if (!strcmp(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { @@ -1917,6 +1918,7 @@ static void demo_init_vk(struct demo *demo) { demo->extension_names[demo->enabled_extension_count++] = VK_KHR_WIN32_SURFACE_EXTENSION_NAME; } + assert(demo->enabled_extension_count < 64); #else // _WIN32 if (!strcmp(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, instance_extensions[i].extensionName)) { @@ -1924,6 +1926,7 @@ static void demo_init_vk(struct demo *demo) { demo->extension_names[demo->enabled_extension_count++] = VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME; } + assert(demo->enabled_extension_count < 64); #endif // _WIN32 if (!strcmp(VK_EXT_DEBUG_REPORT_EXTENSION_NAME, instance_extensions[i].extensionName)) { -- 2.7.4