Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Coverity issues for log_capture #27

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crashlog/crashutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ unsigned long long get_uptime(int refresh, int *error)
}

// Find system last kmsg from dropbox
static int find_system_last_kmsg(char *source, int source_length) {
static int find_system_last_kmsg(char source[], int source_length) {
struct dirent *entry;
DIR *dir = opendir(DROPBOX_DIR);
int file_exist = 0;
Expand All @@ -189,7 +189,7 @@ static int find_system_last_kmsg(char *source, int source_length) {

void do_last_kmsg_copy(char *dir) {
char destion[PATHMAX];
char source[PATHMAX];
char source[PATHMAX]={0};
char sourcepath[PATHMAX];

if ( file_exists(LAST_KMSG) ) {
Expand All @@ -206,7 +206,7 @@ void do_last_kmsg_copy(char *dir) {
snprintf(destion, sizeof(destion), "%s/%s", dir, FTRACE_RAMOOPS_FILE);
do_copy_tail(FTRACE_RAMOOPS, destion, MAXFILESIZE);
}
if (find_system_last_kmsg(&source, sizeof(source))) {
if (find_system_last_kmsg(source, sizeof(source))) {
snprintf(destion, sizeof(destion), "%s/%s", dir, source);
snprintf(sourcepath, sizeof(sourcepath), "%s/%s", DROPBOX_DIR, source);
do_copy_tail(sourcepath, destion, MAXFILESIZE);
Expand Down