Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#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:


#;1> (blob=? '#${1 2 3} '#${1 2 4})
#;2> (blob=? '#${1 2 0 3} '#${1 2 0 4})

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 12 years ago by sjamaan

Sent a patch to chicken-hackers

comment:2 Changed 12 years ago by sjamaan

Resolution: fixed
Status: newclosed

This is (hopefully completely) fixed now, by changesets 5da352371df6544073186206fa505b480dfa6499 and 1be37b85437c8e0644964ed6ca7b54a1ecfd29b5 in master. (thanks, Jim!)

comment:3 Changed 12 years ago by felix winkelmann


Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.