Thread: Avoiding Buffer Overflows

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    162

    Avoiding Buffer Overflows

    How can one avoid buffer overflows when wanting to format strings or convert numbers to strings? Is there any equivalent functions to for ex. itoa() or sprintf(), where a maximum buffer length can be sent or a required length can be retained? Or is the only way of achieving this by writing your own functions?

    Please note that simply allocating a very large buffer is not the solution I am looking for.
    Thanks in advance
    Last edited by Aidman; 01-03-2004 at 11:31 AM.
    We haven't inherited Earth from our parents; instead we have borrowed her from our children - old Indian saying.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 10-29-2006, 05:04 AM
  2. writing a pack-style function, any advices?
    By isaac_s in forum C Programming
    Replies: 10
    Last Post: 07-08-2006, 08:09 PM
  3. Question on buffer overflows
    By maxhavoc in forum C++ Programming
    Replies: 3
    Last Post: 11-25-2004, 03:48 PM
  4. buffer contents swapping
    By daluu in forum C++ Programming
    Replies: 7
    Last Post: 10-14-2004, 02:34 PM
  5. Console Screen Buffer
    By GaPe in forum Windows Programming
    Replies: 0
    Last Post: 02-06-2003, 05:15 AM