Skip to content

Commit 79f206b

Browse files
log-manager: fix arg bounds
An incorrect argument count check results in `argv[1]` being accessed even when it is not provided. This causes a SEGV on launch of the daemon in normal cases (on a system) when the temporary path location is not provided. Fixes: fa2d962 Signed-off-by: Patrick Williams <[email protected]> Change-Id: Ibe7254533cb6002d73c5a1ada8bb1f35e9c9df53
1 parent 730c40f commit 79f206b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

log_manager_main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ int main(int argc, char* argv[])
1717
{
1818
PHOSPHOR_LOG2_USING_WITH_FLAGS;
1919

20-
if (argc >= 1)
20+
if (argc >= 2)
2121
{
2222
PERSIST_PATH_ROOT = strdup(argv[1]);
2323
info("Using temporary {PATH} for logs", "PATH", PERSIST_PATH_ROOT);

0 commit comments

Comments
 (0)