Fix overflow accessing 08/283808/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 3 Nov 2022 07:14:31 +0000 (16:14 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Thu, 3 Nov 2022 07:14:31 +0000 (16:14 +0900)
Change-Id: If83ac5bcfff383b1b634d44c3fc4ecc37515deb5

tools/tdm_test_client.c

index a3f9cb2..c989200 100644 (file)
@@ -447,7 +447,10 @@ _voutput_output_handler(tdm_client_output *output, tdm_output_change_type type,
 
        if (type == TDM_OUTPUT_CHANGE_CONNECTION) {
                status = (tdm_output_conn_status)value.u32;
-               printf("output %s.\n", conn_str[value.u32]);
+               if (value.u32 < 3)
+                       printf("output %s.\n", conn_str[value.u32]);
+               else
+                       printf("output unkown.\n");
 
                if (status == TDM_OUTPUT_CONN_STATUS_DISCONNECTED) {
                        printf("client: disconnected, destroy voutput\n");