diff options
author | Jihoon Kim <jihoon48.kim@samsung.com> | 2024-01-17 13:48:07 +0900 |
---|---|---|
committer | Jihoon Kim <jihoon48.kim@samsung.com> | 2024-01-17 14:14:57 +0900 |
commit | b5c5c305e3c123948fd43c8b348c08e6aac9055e (patch) | |
tree | 9f41322f818ac67c09833380209dbaaa79c6a56f | |
parent | ddfe57f9a5c8bf55ef370b1a26d9ed0fee62196c (diff) | |
download | libxkbcommon-b5c5c305e3c123948fd43c8b348c08e6aac9055e.tar.gz libxkbcommon-b5c5c305e3c123948fd43c8b348c08e6aac9055e.tar.bz2 libxkbcommon-b5c5c305e3c123948fd43c8b348c08e6aac9055e.zip |
Fix dereference after NULL issueaccepted/tizen/unified/riscv/20240118.054547accepted/tizen/unified/20240117.163255accepted/tizen_unified_riscv
Change-Id: I845ecb7e7fc6b6242e755a336f0e7e1429ae4bf9
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
-rw-r--r-- | src/atom.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -148,6 +148,9 @@ atom_intern(struct atom_table *table, const char *string, size_t len, bool add) if (darray_size(table->strings) > 0.80 * table->index_size) { table->index_size *= 2; table->index = realloc(table->index, table->index_size * sizeof(*table->index)); + if (!table->index) + return XKB_ATOM_NONE; + memset(table->index, 0, table->index_size * sizeof(*table->index)); for (size_t j = 1; j < darray_size(table->strings); j++) { const char *s = darray_item(table->strings, j); |