linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Glynn Clements <glynn.clements@virgin.net>
To: linux-c-programming@vger.kernel.org
Subject: Re: exploitable function
Date: Wed, 26 Jun 2002 20:26:03 +0100	[thread overview]
Message-ID: <15642.5451.365778.941333@cerise.nosuchdomain.co.uk> (raw)
In-Reply-To: <20020626164110.B1131@neutrino.particles.org>


Elias Athanasopoulos wrote:

> > by the way, where can i find a exploitable function and try to
> > code epxloit proof for education and practice?
> 
> strcpy() is the number-one danger.

But note that strncpy() isn't much better, for two reasons:

1. If the source is longer than the size of the buffer, there won't be
a terminating NUL in the result.

2. If a string is too long, simply truncating it to a fixed length is
seldom the correct response, and may have security implications. It's
usually preferable to treat this situation as a fatal error, and
terminate the program.

-- 
Glynn Clements <glynn.clements@virgin.net>

  reply	other threads:[~2002-06-26 19:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-25 21:02 exploitable function xlp
2002-06-25 21:43 ` Elias Athanasopoulos
     [not found]   ` <20020625163329.C27404@nietzsche>
2002-06-26 13:41     ` Elias Athanasopoulos
2002-06-26 19:26       ` Glynn Clements [this message]
2002-06-26 20:58         ` Elias Athanasopoulos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15642.5451.365778.941333@cerise.nosuchdomain.co.uk \
    --to=glynn.clements@virgin.net \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).