View Single Post
  #2   Spotlight this post!  
Unread 08-03-2004, 02:32
Jay Lundy Jay Lundy is offline
Programmer/Driver 2001-2004
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Jun 2001
Rookie Year: 2001
Location: Berkeley, CA
Posts: 320
Jay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to all
Re: printf bug - beware!

Nice catch. The same problem occurs if you do this:

char tempBuf[] = "Some string >=40 characters...";
printf("%s", tempBuf);

The error is another strcpypgm2ram copied into a 40 char buffer without checking the length of the string in program memory.

printf_lib.c line 203 (unmodified version)

Basically anywhere in the printf libraries where strcpypgm2ram is used (which is quite often) there is a possibility for corruption.