#808 closed defect (fixed)
Blobs are compared with ASCIIZ string comparison functions
Reported by: | sjamaan | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | 4.9.0 |
Component: | unknown | Version: | 4.7.x |
Keywords: | C sucks, blobs, strings | Cc: | |
Estimated difficulty: |
Description
#;1> (blob=? '#${1 2 3} '#${1 2 4}) #f #;2> (blob=? '#${1 2 0 3} '#${1 2 0 4}) #t
The fix is most likely to use C_memcmp
instead of C_strncmp
since blob=?
uses C_string_compare. I'm posting it in the bugtracker because we should really check all string functions (since strings in Scheme can contain NUL bytes too); there are many more cases where C functions are used (and for case-insensitive comparisons this is especially painful - we'd need to hand-code those since there are no C functions that deal with length-encoded strings; they all implicitly assume ASCIIZ)
Change History (3)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
This is (hopefully completely) fixed now, by changesets 5da352371df6544073186206fa505b480dfa6499 and 1be37b85437c8e0644964ed6ca7b54a1ecfd29b5 in master. (thanks, Jim!)
Sent a patch to chicken-hackers