dbuspolicy-printer: fix segfault due to invalid input 28/211128/1
authorsanghyeok.oh <sanghyeok.oh@samsung.com>
Tue, 30 Jul 2019 08:06:38 +0000 (17:06 +0900)
committersanghyeok.oh <sanghyeok.oh@samsung.com>
Tue, 30 Jul 2019 08:07:20 +0000 (17:07 +0900)
-i opt expecting serialized file.

Change-Id: I31bde3750deaa43c8148f2469e74a52e7ef4ba15
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
src/dbuspolicy_printer.cpp

index 25a45fa..691ea20 100644 (file)
@@ -14,7 +14,7 @@ static const struct option options[] = {
 
 static void print_help(const char *name) {
        cout << endl;
-       cout << "usage: " << name << " [-i input_filename] [-v]" << endl;
+       cout << "usage: " << name << " [-i serialized filename] [-v]" << endl;
        cout << "       " << name << " {--system|--session} [-v]" << endl;
        cout << " -v - just verify, don't print anything" << endl;
        cout << endl;
@@ -69,7 +69,7 @@ int main(int argc, char *argv[]) {
 
        ldp_serialized::StorageBackendSerialized storage;
 
-       if (!storage.init(input_filename.c_str(), just_verify)) {
+       if (!storage.init(input_filename.c_str(), true)) {
                if (just_verify)
                        cout << input_filename << ": FAILED" << endl;
                return EXIT_FAILURE;