]> sourceware.org Git - libabigail.git/commit
Fix --type-id-style hash for empty internal names.
authorGiuliano Procida <gprocida@google.com>
Mon, 6 Jul 2020 09:21:33 +0000 (10:21 +0100)
committerDodji Seketeli <dodji@redhat.com>
Mon, 27 Jul 2020 09:23:26 +0000 (11:23 +0200)
commitbe0effa6fdbca63be95373c6b77222781fc25ef1
tree6d12eb1f2be590f7833d788898d59da917efa351
parent96ce0785fd334ce8397053732022c0dec6b9c9f2
Fix --type-id-style hash for empty internal names.

libabigail's intern_string class treats the empty string specially. It
is not safe to call the raw method without checking for a empty
pointer. It is safe to convert to std::string.

This commit changes the XML writer to convert interned strings to
std::strings before computing their hashes.

* src/abg-writer.cc (write_context::get_id_for_type): When
hashing internal type names, convert to std::string rather
than using the raw method directly as this will avoid a null
pointer dereference in the case of an empty string; tabify
code indentation.

Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-writer.cc
This page took 0.031954 seconds and 5 git commands to generate.