diff --git a/src/mountinfo.c b/src/mountinfo.c index 82d042e..686a40d 100644 --- a/src/mountinfo.c +++ b/src/mountinfo.c @@ -235,6 +235,7 @@ static struct mountinfo_entry *parse_mountinfo_entry(const char *line) if ((entry->mount_opts = parse_next_string_field()) == NULL) goto fail; entry->optional_fields = &entry->line_buf[0] + total_used++; + // NOTE: This ensure s that optional_fields is never NULL. strcpy(entry->optional_fields, ""); for (;;) { char *opt_field = parse_next_string_field();