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.

Fixes: e76f847 ("ovsdb-server: Database config isolation.")
Reported-at: https://issues.redhat.com/browse/FDP-1118
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
  • Loading branch information
mkp-rh authored and igsilya committed Feb 12, 2025
1 parent a8f5a97 commit f142ba5
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 @@ -503,7 +503,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 f142ba5

Please sign in to comment.