GNU bug report logs -
#56413
[PATCH 1/1] scm_i_utf8_string_hash: compute u8 chars not bytes
Previous Next
Reported by: Rob Browning <rlb <at> defaultvalue.org>
Date: Wed, 6 Jul 2022 01:25:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Rob Browning <rlb <at> defaultvalue.org> skribis:
> So this change *could* alter results, but only for non-ASCII strings,
> and those results would have been wrong (i.e. relying on uninitialized
> memory).
OK, that was my understanding too.
> That leaves the size_t -> long change in scm_i_str2symbol(), and I don't
> think that has anything to do with UTF-8, but it could cause mangling of
> the value on any platform where the data types differ sufficiently, and
> then of course if we're not using the same type consistently, then we
> could give different answers for the same symbol in different contexts
> (for different code paths).
Right. This one looks safe to me.
> And indeed, looks like I missed another case; just below in
> scm_i_str2uninterned_symbol() we also use size_t. For now, I suspect we
> should change both or neither, and definitely change them all to match
> "eventually".
Sure.
Thanks!
Ludo’.
This bug report was last modified 2 years and 98 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.