summaryrefslogtreecommitdiff
path: root/NEWS
diff options
context:
space:
mode:
authorRob Browning <rlb@defaultvalue.org>2023-03-12 14:26:10 -0500
committerRob Browning <rlb@defaultvalue.org>2023-03-18 13:24:43 -0500
commitffb95239aacf86d8dc622a438bdaacfac4a66efc (patch)
treed49911a0abac917a73b6ec6e0e2c0ec0ade6f426 /NEWS
parentf0df1ed0fdca7a63cffda5e53c968e814b7b06ec (diff)
downloadguile-ffb95239aacf86d8dc622a438bdaacfac4a66efc.tar.gz
scm_i_utf8_string_hash: compute u8 chars not bytes
Noticed while investigating a migration to utf-8 strings. After making changes that routed non-ascii symbol hashing through this function, encoding-iso88597.test began intermittently failing because it would traverse trailing garbage when u8_strnlen reported 8 chars instead of 4. Change the scm_i_str2symbol and scm_i_str2uninterned_symbol internal hash type to unsigned long to explicitly match the scm_i_string_hash result type. * libguile/hash.c (scm_i_utf8_string_hash): Call u8_mbsnlen not u8_strnlen. * libguile/symbols.c (scm_i_str2symbol, scm_i_str2uninterned_symbol): Use unsigned long for scm_i_string_hash result. * test-suite/standalone/.gitignore: Add test-hashing. * test-suite/standalone/Makefile.am: Add test-hashing. * test-suite/standalone/test-hashing.c: Add.
Diffstat (limited to 'NEWS')
-rw-r--r--NEWS12
1 files changed, 12 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index a0009406f..a55cb583b 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,18 @@ definitely unused---this is notably the case for modules that are only
used at macro-expansion time, such as (srfi srfi-26). In those cases,
the compiler reports it as "possibly unused".
+* Bug fixes
+
+* Hashing of UTF-8 symbols with non-ASCII characters avoids corruption
+
+This issue could cause `scm_from_utf8_symbol' and
+`scm_from_utf8_symboln` to incorrectly conclude that the symbol hadn't
+already been interned, and then create a new one, which of course
+wouldn't be `eq?' to the other(s). The incorrect hash was the result of
+a buffer overrun, and so might vary. This problem affected a number of
+other operations, given the internal use of those functions.
+(<https://bugs.gnu.org/56413>)
+
Changes in 3.0.9 (since 3.0.8)