aurum: fix using calloc instead of variable-sized array. 13/285413/2 accepted/tizen/unified/20221215.051045
authorHosang Kim <hosang12.kim@samsung.com>
Mon, 12 Dec 2022 09:04:11 +0000 (18:04 +0900)
committerkim hosang <hosang12.kim@samsung.com>
Tue, 13 Dec 2022 04:43:16 +0000 (04:43 +0000)
C++ template doesn't support variable-sized array.

Change-Id: I57b3fd7e2a117ead55ac705b867144885433d938

org.tizen.aurum-bootstrap/src/Commands/TakeScreenshotCommand.cc

index b9e5c0a..2a62457 100644 (file)
@@ -50,7 +50,7 @@ TakeScreenshotCommand::TakeScreenshotCommand(
     std::ifstream ifs(path, std::ifstream::binary);
     ::aurum::RspTakeScreenshot rsp;
     int size = mDevice->getScreenSize().width * mDevice->getScreenSize().height;
-    char buf[size];
+    char *buf = (char *) calloc(size, sizeof(char));
 
     while (!ifs.eof()) {
         ifs.read(buf, size);