代码搜索:malloc
找到约 10,000 项符合「malloc」的源代码
代码结果 10,000
www.eeworm.com/read/162614/5540424
c fail8-frag.c
#include
#include
#include
int main ()
{
char *foo;
char *bar;
foo = (char *)malloc (10);
bar = (char *)malloc (10);
free(bar);
memcpy(foo, bar, 10);
return 0;
}
/* {
www.eeworm.com/read/162614/5540428
c fail29-frag.c
#include
#include
int foo (int u[10])
{
return u[8]; /* this dereference should be instrumented */
}
int main ()
{
int *k = malloc (6);
return foo (k);
}
/* { dg-output "mud
www.eeworm.com/read/162614/5540431
c fail21-frag.c
#include
#include
#include
int main ()
{
int *bar = (int *) malloc (sizeof (int));
/* Make an access here to get &foo into the lookup cache. */
*bar = 5;
__mf_watch (
www.eeworm.com/read/162614/5540437
c fail6-frag.c
#include
#include
#include
int main ()
{
char *foo;
char *bar;
foo = (char *)malloc (10);
bar = (char *)malloc (15);
memcpy(foo, bar, 11);
return 0;
}
/* { dg-output "
www.eeworm.com/read/162614/5540447
c pass24-frag.c
#include
#include
#include
int main ()
{
struct foo {
int zoo;
int bar [10];
float baz;
};
#define offsetof(S,F) ((size_t) & (((S *) 0)->F))
struct foo *k = (st
www.eeworm.com/read/162614/5540448
c fail28-frag.c
#include
#include
#include
int foo (int *u, int i)
{
return u[i]; /* this dereference should be instrumented */
}
int main ()
{
int *k = malloc (6);
return foo (k
www.eeworm.com/read/162614/5540451
c fail19-frag.c
#include
#include
#include
int main ()
{
struct foo {
int bar [10];
};
struct foo *k = (struct foo *) malloc (2 * sizeof(int));
k->bar[5] = 9;
free (k);
return 0;
}
www.eeworm.com/read/162614/5540460
c fail17-frag.c
#include
#include
#include
int main ()
{
char * x;
int foo;
x = (char *) malloc (10);
strcpy (x, "123456789");
foo = strlen (x+10);
x [foo] = 1; /* we just just use fo
www.eeworm.com/read/162614/5540467
c fail12-frag.c
#include
#include
#include
int main ()
{
int i = 10;
int *x = (int *) malloc (i * sizeof (int));
while (i--)
{
++x;
*x = 0;
}
return 0;
}
/* { dg-output "mudflap v
www.eeworm.com/read/162614/5540474
c fail25-frag.c
#include
#include
#include
int main ()
{
char *foo;
char *bar;
__mf_set_options ("-check-initialization");
foo = (char *)malloc (10);
bar = (char *)malloc (10);
/* bar[