diff options
author | YoungHun Kim <yh8004.kim@samsung.com> | 2023-02-22 10:16:29 +0900 |
---|---|---|
committer | YoungHun Kim <yh8004.kim@samsung.com> | 2023-02-27 06:24:44 +0000 |
commit | f9e6cb91c1bfb2f9c1f4fb2be23a77b8d63015af (patch) | |
tree | 8cf374ffea92206437f7e3380661b2073cf935c8 | |
parent | a2d74c342154ac9b551c041609e19e1c5d9c15b4 (diff) | |
download | murphy-f9e6cb91c1bfb2f9c1f4fb2be23a77b8d63015af.tar.gz murphy-f9e6cb91c1bfb2f9c1f4fb2be23a77b8d63015af.tar.bz2 murphy-f9e6cb91c1bfb2f9c1f4fb2be23a77b8d63015af.zip |
Add a null check to avoid dereferencing a null pointeraccepted/tizen/7.0/unified/20230228.035401
Change-Id: I72f1dfc45f8765061fc46937e6e3a24f355b7ff1
(cherry picked from commit 41b53ba1640137a6a6b0d6318d5a197534bc89f7)
-rw-r--r-- | packaging/murphy.spec | 2 | ||||
-rw-r--r-- | src/core/console.c | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/packaging/murphy.spec b/packaging/murphy.spec index 12e9d92..11b78d0 100644 --- a/packaging/murphy.spec +++ b/packaging/murphy.spec @@ -29,7 +29,7 @@ Summary: Resource policy framework Name: murphy Version: 0.0.75 -Release: 23 +Release: 24 License: BSD-3-Clause Group: System/Service URL: http://01.org/murphy/ diff --git a/src/core/console.c b/src/core/console.c index a9591b1..720efbc 100644 --- a/src/core/console.c +++ b/src/core/console.c @@ -700,14 +700,16 @@ static ssize_t input_evt(mrp_console_t *mc, void *buf, size_t size) clearerr(stdout); clearerr(stderr); - MRP_CONSOLE_BUSY(mc, { - if (cmd->flags & MRP_CONSOLE_RAWINPUT) { - raw = raw_argument(buf, grp->name, cmd->name); - cmd->raw(mc, grp->user_data, grp->name, cmd->name, raw); - } - else - cmd->tok(mc, grp->user_data, argc, argv); - }); + if (grp != NULL) { + MRP_CONSOLE_BUSY(mc, { + if (cmd->flags & MRP_CONSOLE_RAWINPUT) { + raw = raw_argument(buf, grp->name, cmd->name); + cmd->raw(mc, grp->user_data, grp->name, cmd->name, raw); + } + else + cmd->tok(mc, grp->user_data, argc, argv); + }); + } /* * Although our watch for c->pout[RFD]/output_cb should take |