9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Mathieu L." <lejatorn@gmail.com>
To: 9fans@9fans.net
Subject: Re: [9fans] dial and buffer overflow
Date: Sun,  5 Jul 2009 00:11:05 +0200	[thread overview]
Message-ID: <24db968438c83ecd8b9573681c244a0b@smgl.fr.eu.org> (raw)
In-Reply-To: <13ea0e308bf246b85add13bec005acd3@quanstro.net>

Thanks for the answer Erik.

[...]
> the extra () around tor->sha1list are confusing.

Noted, thanks, they're gone. I suck at remembering operators precedence
so I usually add a few parentheses to be on the safe side.

> it is more likely that you have some allocation
> error in your code.  neither netmkaddr nor
> dial do any allocation, so i don't see how memory
> on the heap could get corrupted without help.
>
> the three most common errors that cause this are
> (a) not allocating enough memory by, e.g.
> malloc(sizeof tor) not malloc(sizeof *tor). or
> (b) pointing to a non-static on the stack,
> or (c) mistyping of tor->sha1list so that sizeof
> tor->sha1list[0][0] != 1.

Could you elaborate on (b), or point me to an example please? I don't
really understand what it means or how it could happen...




  reply	other threads:[~2009-07-04 22:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-04 15:43 Mathieu L.
2009-07-04 20:43 ` erik quanstrom
2009-07-04 22:11   ` Mathieu L. [this message]
2009-07-05  0:36     ` erik quanstrom

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=24db968438c83ecd8b9573681c244a0b@smgl.fr.eu.org \
    --to=lejatorn@gmail.com \
    --cc=9fans@9fans.net \
    /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).