On Fri, Dec 16, 2016 at 08:05:35PM +0100, Julia Lawall wrote:
>
>
> On Fri, 16 Dec 2016, Thomas Adam wrote:
>
> > On Fri, Dec 16, 2016 at 07:30:46PM +0100, Julia Lawall wrote:
> > > The file I got had only pkg_vset, with some comments and includes
> > > beforehand. Perhaps you sent the wrong one.
> >
> > Sorry, I meant pkg_vset() -- there's too many moving parts! I'm sending the
> > entire .c file so that you might better place it in context with the debug
> > file I attached in my previous email. Needless to say, despite my
> > chopping/changing this file, it's still not working.
>
> For me they are all transformed. What is your version of spatch? What is
> your command line? What is your semantic patch (you sent it before, but I
> no longer have it)?
% spatch --version
spatch version 1.0.4 with Python support and with PCRE support
See 'unchecked_malloc.cocci' attached.
I'm invoking spatch like this:
spatch --in-place --sp-file ~/unchecked_malloc.cocci libpkg/pkg.c
init_defs_builtins: /usr/local/lib/coccinelle/standard.h
HANDLING: libpkg/pkg.c
Note: processing took 16.3s: libpkg/pkg.c
libpkg/pkg.c contains no transformations.
This is running atop of FreeBSD, should that somehow make any difference.
Thanks again!
Thomas
@@
expression T;
@@
T = malloc(...);
+ if (T == NULL)
+ pkg_emit_errno("malloc", __func__);
... when != (T == NULL)
when != (T != NULL)
@@
expression T;
@@
T = calloc(...);
+ if (T == NULL)
+ pkg_emit_errno("calloc", __func__);
... when != (T == NULL)
when != (T != NULL)
@@
expression T;
@@
T = realloc(...);
+ if (T == NULL)
+ pkg_emit_errno("realloc", __func__);
... when != (T == NULL)
when != (T != NULL)
@@
expression T;
@@
T = strdup(...);
+ if (T == NULL)
+ pkg_emit_errno("strdup", __func__);
... when != (T == NULL)
when != (T != NULL)
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci