From: elfring@users.sourceforge.net (SF Markus Elfring)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Checking for null pointers
Date: Sat, 09 May 2015 13:01:28 +0200 [thread overview]
Message-ID: <554DE908.5060009@users.sourceforge.net> (raw)
In-Reply-To: <CABBGRWvwuuVAyB_re1h-W4p2Gye-r195x5yjaxnURzuZX2Gaqg@mail.gmail.com>
> i want that my script detects only the dereference of a pointer
> when it is not checked different from NULL.
Does your goal belong to the usual software development challenges around
proper handling of return values?
https://cwe.mitre.org/data/definitions/252.html
> i want that my script detects only the dereference of a pointer
> and not the declaration ( exemple : int *k ;) or the cast ( exemple : int *k ;)
I can understand that.
> or the initialisation ( (int) *s = &1;)
I would check also such source code places.
> @r@
> position p1 != {safe1.p,safe2.p};
Is such a SmPL constraint really needed?
> expression x;
> identifier y;
> @@
>
> *x at p1->y
Which meaning should the asterisk get here?
- SmPL marker
- pointer dereference
Regards,
Markus
next prev parent reply other threads:[~2015-05-09 11:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-07 9:00 [Cocci] Asking for help Zied Habtoul
2015-05-09 7:11 ` [Cocci] Checking for null pointers SF Markus Elfring
2015-05-09 10:31 ` Zied Habtoul
2015-05-09 11:01 ` SF Markus Elfring [this message]
2015-05-09 11:06 ` Zied Habtoul
2015-05-09 11:37 ` SF Markus Elfring
2015-05-09 11:48 ` Zied Habtoul
2015-05-09 12:01 ` SF Markus Elfring
2015-05-09 12:16 ` Zied Habtoul
2015-05-09 12:32 ` SF Markus Elfring
2015-05-09 12:39 ` Zied Habtoul
2015-05-09 13:00 ` SF Markus Elfring
2015-05-09 12:29 ` Julia Lawall
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=554DE908.5060009@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=cocci@systeme.lip6.fr \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.