Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Administrivia: List Announcement

From: Edinelson Keiji Shimokawa <dev(at)pop.com.br>
Date: Wed May 14 2003 - 09:21:28 EDT

Benjamin A. Okopnik disse:

> l1 = strlen(p1);

I think that there we need to code:

> l1 = strlen(buf1);
> s1 = sizeof(buf1);
> l2 = strlen(buf2);
> s2 = sizeof(buf2);

but, I coded and the results:
# ./a.out `perl -e 'print "A" x 251;print " "; print "B" x 251'` strlen1: 251 sizeof1: 4
strlen2: 251 sizeof2: 4
# ./a.out `perl -e 'print "A" x 252;print " "; print "B" x 251'` strlen1: 254 sizeof1: 4
strlen2: 251 sizeof2: 4
# ./a.out `perl -e 'print "A" x 253;print " "; print "B" x 251'` Segmentation fault
# ./a.out `perl -e 'print "A" x 252;print " "; print "B" x 252'` strlen1: 254 sizeof1: 4
strlen2: 254 sizeof2: 4
# ./a.out `perl -e 'print "A" x 251;print " "; print "B" x 252'` strlen1: 251 sizeof1: 4
strlen2: 254 sizeof2: 4
# ./a.out `perl -e 'print "A" x 252;print " "; print "B" x 253'` strlen1: 254 sizeof1: 4
strlen2: 254 sizeof2: 4
# ./a.out `perl -e 'print "A" x 252;print " "; print "B" x 254'` strlen1: 254 sizeof1: 4
strlen2: 254 sizeof2: 4
# ./a.out `perl -e 'print "A" x 252;print " "; print "B" x 255'` strlen1: 254 sizeof1: 4
strlen2: 254 sizeof2: 4

mmm... it seems that buf2 overflowed 2 bytes. try other sizes for SIZE. I have tried 248 and 250. it's amazing that doesn't sigfaults. seems a very special condition.

Edinelson Keiji Shimokawa.
A jedi prentice owned by Dark Force.  

-- 
POP. Nem parece internet grátis. 

Seja POP você também!
Acesse: 
http://www.pop.com.br/pop_discador.php e baixe o POPdiscador.
Received on Wed May 14 12:28:33 2003
Do you need help?X

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:07:39 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library