Summary
Blobs are compared with ASCIIZ string comparison functions
Metadata
- Id: c7b21fc7f5048becf4aabe00b16045b5651d1728
- Trac id: 808
- Type: defect
- Reporter: sjamaan
- Owner:
- Cc:
- Status: closed
- Component: unknown
- Estimated difficulty:
- Resolution: fixed
- Priority: critical
- Milestone: 4.9.0
- Version: 4.7.x
- Changetime: 2012-09-24 21:47:48 UTC
- Created: 2012-04-05 21:06:11 UTC
- Keywords: C sucks, blobs, strings
Description
#!scm
#;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)
Changes and comments
[2012-04-22 15:52:47 UTC] sjamaan wrote:
Sent a patch to chicken-hackers
[2012-04-23 20:30:26 UTC] sjamaan changed status from new to closed
[2012-04-23 20:30:26 UTC] sjamaan set resolution to fixed
[2012-04-23 20:30:26 UTC] sjamaan wrote:
This is (hopefully completely) fixed now, by changesets 5da352371df6544073186206fa505b480dfa6499 and 1be37b85437c8e0644964ed6ca7b54a1ecfd29b5 in master. (thanks, Jim!)
[2012-09-24 21:47:48 UTC] felix changed milestone from 4.8.0 to 4.9.0
[2012-09-24 21:47:48 UTC] felix wrote:
Milestone 4.8.0 deleted