From: David Ross Date: 2004-08-28T13:48:01+09:00 Subject: Re: performance comparison --- Jamis Buck wrote: > To clarify, then: David, you are talking about the C > 'gets()' function, > correct? I agree that it should be avoided at all > costs. However, Ruby's > "gets()" function does not map directly to a C > "gets()" invocation -- it > does a lot more work, including bounds checking. > Thus, saying "gets() > is unsafe in every language" is rather misleading. I > won't say it is > "safe" in Ruby, since I'm not an expert in this > area, but it is > certainly not as hazardous to use as in vanilla C > code. > > (Someone please flame me gently if I've mispoken > anything grossly > regarging Ruby's internals...) > > - Jamis > hrm.. well I don't know for sure.. I was told on freenode #ruby-lang it was insecure when I asked about it. Though I never actually read through the code to see. reading code... appendline(..) is restricted to 8192 bytes. :) Okay, so it does perform checking. A specification on ruby would really help :) Its really hard reading thousands of lines of code and trying to understand all of ruby. Matz: *cough* *cough* you should write what is in your head and on paper for everybody :) ..... int cnt = bp - buf; if (cnt > 0) { ..... ---------------------------------------- -- Name: David Ross -- Phone: 8965.539.3798 -- Email: drossruby [at] yahoo [dot] com ---------------------------------------- __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail