Skip to content

Commit

Permalink
Fix NULL pointer access in systemd-sonic-generator
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Sun <[email protected]>
  • Loading branch information
stephenxs committed Jan 8, 2024
1 parent c0bc1d9 commit 57f2e49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/systemd-sonic-generator/systemd-sonic-generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ int get_install_targets(char* unit_file, char* targets[]) {
char* token;
char* line = NULL;
bool first;
char* target_suffix;
char* target_suffix = NULL;
char *instance_name;
char *dot_ptr;

Expand Down Expand Up @@ -308,7 +308,7 @@ int get_install_targets(char* unit_file, char* targets[]) {
target_suffix = ".wants";
}
}
else {
else if (NULL != target_suffix) {
found_targets = get_install_targets_from_line(token, target_suffix, targets, num_targets);
num_targets += found_targets;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ StartLimitBurst=3
User=root
ExecStop=/usr/bin/test.sh stop
[Install]
Alias=alias
WantedBy=multi-user.target

0 comments on commit 57f2e49

Please sign in to comment.