Skip to content

Commit

Permalink
protect ovis_log_flush from invalid arguments.
Browse files Browse the repository at this point in the history
ovis_log_flush can be called in any order wrt initialization,
so it must be guarded against null and syslog values.
  • Loading branch information
baallan committed Jan 19, 2024
1 parent 1e39a78 commit e306026
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/src/ovis_log/ovis_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,8 @@ int ovis_log_open(const char *path)

int ovis_log_flush()
{
return fflush(log_fp);
if (log_fp && log_fp != OVIS_LOG_SYSLOG)
return fflush(log_fp);
}

int ovis_log_close()
Expand Down

0 comments on commit e306026

Please sign in to comment.