Fix [ASAN][BUG] heap-buffer-overflow in sdbd 57/275957/1 accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.062403 accepted/tizen/7.0/unified/hotfix/20221116.112214 accepted/tizen/unified/20220608.140018 submit/tizen/20220607.112302 tizen_7.0_m2_release
authorDongkyun Son <dongkyun.s@samsung.com>
Tue, 7 Jun 2022 09:13:13 +0000 (18:13 +0900)
committerDongkyun Son <dongkyun.s@samsung.com>
Tue, 7 Jun 2022 09:24:25 +0000 (18:24 +0900)
Change-Id: I233898809080cce9915418a586873d9d65c7ea2b
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>y
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
src/default_plugin_basic.c

index 8d6a1f4f86f9e04724fa4c58f05f417d3398e011..b311a455c78cfe084d1b712440552fb787407631 100755 (executable)
@@ -383,7 +383,9 @@ int verify_handle_by_plugin ( parameters* in, parameters* out )
     }
 
     //the data contains the string sample-echo followed by space and then the user string, hence checking for space.
-    if((in->array_of_parameter[0].v_string.data[11] == ' ')&&(!strncmp(in->array_of_parameter[0].v_string.data, "sample-echo", strlen("sample-echo")))) {
+    if((in->array_of_parameter[0].v_string.length >= 12) &&
+            (in->array_of_parameter[0].v_string.data[11] == ' ') &&
+            (!strncmp(in->array_of_parameter[0].v_string.data, "sample-echo", strlen("sample-echo")))) {
        out->array_of_parameter[0].type = type_int32;
        out->array_of_parameter[0].v_int32 = PLUGIN_RET_HANDLE;
     }