Skip to content
Snippets Groups Projects
Commit 8ff5315e authored by Howard Ro's avatar Howard Ro
Browse files

Fix out of bound error of IncidentService

Before this change, it was possible for the code to suffer an out of
bound error.

Bug: 150706572
Test: make
Change-Id: I3e8d37f2ee3c942bc9b176edee043557b005c757
parent 2ac5ff2b
No related branches found
No related tags found
No related merge requests found
......@@ -554,6 +554,10 @@ status_t IncidentService::command(FILE* in, FILE* out, FILE* err, Vector<String8
return NO_ERROR;
}
if (!args[0].compare(String8("section"))) {
if (argCount == 1) {
fprintf(out, "Not enough arguments for section\n");
return NO_ERROR;
}
int id = atoi(args[1]);
int idx = 0;
while (SECTION_LIST[idx] != NULL) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment