Skip to content

Commit

Permalink
ovsdb-server: Do not use filename after free.
Browse files Browse the repository at this point in the history
Scanhub reported the following splat:

3. ovsdb/ovsdb-server.c:505:5:
    freed_arg: "shash_replace_nocopy" frees "filename".
6. ovsdb/ovsdb-server.c:507:9:
    pass_freed_arg: Passing freed pointer "filename" as an argument to
    "vlog".

In all code paths with a duplicate configuration, OVSDB would print a
warning log message using a freed pointer. Now, the original option is
used.

Reported-at: https://issues.redhat.com/browse/FDP-1118
Signed-off-by: Mike Pattrick <[email protected]>
Signed-off-by: 0-day Robot <[email protected]>
  • Loading branch information
mkp-rh authored and ovsrobot committed Feb 10, 2025
1 parent f2fac92 commit b23016c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ovsdb/ovsdb-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ add_database_config(struct shash *db_conf, const char *opt,

conf = shash_replace_nocopy(db_conf, filename, conf);
if (conf) {
VLOG_WARN("Duplicate database configuration: %s", filename);
VLOG_WARN("Duplicate database configuration: %s", opt);
db_config_destroy(conf);
}
}
Expand Down

0 comments on commit b23016c

Please sign in to comment.