diff options
author | David Robillard <d@drobilla.net> | 2020-12-16 10:52:37 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-12-16 10:52:37 +0100 |
commit | 02027eec2603a83218cb837d6c33b601e8ef8efa (patch) | |
tree | 4389190a374569dab7164dbed4e77bcd253a1e27 | |
parent | 0f84ab1b34e684f3e80c75296ded90eaf27c49fc (diff) | |
download | sratom-02027eec2603a83218cb837d6c33b601e8ef8efa.tar.gz sratom-02027eec2603a83218cb837d6c33b601e8ef8efa.tar.bz2 sratom-02027eec2603a83218cb837d6c33b601e8ef8efa.zip |
Fix potential null pointer dereference
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | src/sratom.c | 11 | ||||
-rw-r--r-- | wscript | 2 |
3 files changed, 16 insertions, 3 deletions
@@ -1,3 +1,9 @@ +sratom (0.6.7) unstable; + + * Fix potential null pointer dereference + + -- David Robillard <d@drobilla.net> Wed, 16 Dec 2020 09:51:51 +0000 + sratom (0.6.6) stable; * Fix various minor warnings and other code quality issues diff --git a/src/sratom.c b/src/sratom.c index 248906f..57f4667 100644 --- a/src/sratom.c +++ b/src/sratom.c @@ -748,8 +748,15 @@ read_node(Sratom* sratom, SerdNode rel = serd_node_new_relative_uri(&uri, &sratom->base, NULL, NULL); uint8_t* path = serd_file_uri_parse(rel.buf, NULL); - lv2_atom_forge_path(forge, (const char*)path, strlen((const char*)path)); - serd_free(path); + if (path) { + lv2_atom_forge_path(forge, + (const char*)path, + strlen((const char*)path)); + serd_free(path); + } else { + // FIXME: Report errors (required API change) + lv2_atom_forge_atom(forge, 0, 0); + } serd_node_free(&rel); } else { lv2_atom_forge_urid(forge, map->map(map->handle, str)); @@ -7,7 +7,7 @@ from waflib.extras import autowaf # major increment <=> incompatible changes # minor increment <=> compatible changes (additions) # micro increment <=> no interface changes -SRATOM_VERSION = '0.6.6' +SRATOM_VERSION = '0.6.7' SRATOM_MAJOR_VERSION = '0' # Mandatory waf variables |