chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-janitors] #808: Blobs are compared with ASCIIZ string compariso


From: Chicken Trac
Subject: [Chicken-janitors] #808: Blobs are compared with ASCIIZ string comparison functions
Date: Thu, 05 Apr 2012 19:06:11 -0000

#808: Blobs are compared with ASCIIZ string comparison functions
-------------------------------------+--------------------------------------
 Reporter:  sjamaan                  |       Owner:       
     Type:  defect                   |      Status:  new  
 Priority:  critical                 |   Milestone:  4.8.0
Component:  unknown                  |     Version:  4.7.x
 Keywords:  C sucks, blobs, strings  |  
-------------------------------------+--------------------------------------
 {{{
 #!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)

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/808>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]