File: coverity.c

package info (click to toggle)
lwip 2.2.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 10,008 kB
  • sloc: ansic: 109,524; cs: 6,714; sh: 115; makefile: 112; perl: 81
file content (106 lines) | stat: -rw-r--r-- 2,308 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
typedef unsigned char err_t;
typedef unsigned int u32_t;
typedef unsigned short u16_t;
typedef unsigned char u8_t;
typedef void sys_sem_t;
typedef void sys_mutex_t;
typedef size_t mem_size_t;
typedef size_t memp_t;
struct pbuf;
struct netif;

void* mem_malloc(mem_size_t size)
{
  __coverity_alloc__(size);
}
void mem_free(void* mem)
{
  __coverity_free__(mem);
}

void* memp_malloc(memp_t type)
{
  __coverity_alloc_nosize__();  
}
void memp_free(memp_t type, void* mem)
{
  __coverity_free__(mem);  
}

void sys_mutex_lock(sys_mutex_t* mutex)
{
  __coverity_exclusive_lock_acquire__(mutex);
}
void sys_mutex_unlock(sys_mutex_t* mutex)
{
  __coverity_exclusive_lock_release__(mutex);
}

u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout)
{
  __coverity_recursive_lock_acquire__(sem);
}
void sys_sem_signal(sys_sem_t *sem)
{
  __coverity_recursive_lock_release__(sem);
}

err_t ethernet_input(struct pbuf *p, struct netif *inp)
{
  __coverity_tainted_string_sink_content__(p); 
}
err_t tcpip_input(struct pbuf *p, struct netif *inp)
{
  __coverity_tainted_string_sink_content__(p); 
}
err_t ip_input(struct pbuf *p, struct netif *inp)
{
  __coverity_tainted_string_sink_content__(p); 
}
err_t ip4_input(struct pbuf *p, struct netif *inp)
{
  __coverity_tainted_string_sink_content__(p); 
}
err_t ip6_input(struct pbuf *p, struct netif *inp)
{
  __coverity_tainted_string_sink_content__(p); 
}

err_t pbuf_take(struct pbuf *buf, const void *dataptr, u16_t len)
{
  __coverity_tainted_string_argument__(buf);
  __coverity_tainted_data_argument__(buf);
}
err_t pbuf_take_at(struct pbuf *buf, const void *dataptr, u16_t len, u16_t offset)
{
  __coverity_tainted_string_argument__(buf);
  __coverity_tainted_data_argument__(buf);
}
err_t pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)
{
  __coverity_tainted_data_transitive__(p_to, p_from);
}
u16_t pbuf_copy_partial(struct pbuf *p, void *dataptr, u16_t len, u16_t offset)
{
  __coverity_tainted_string_argument__(dataptr);
  __coverity_tainted_data_argument__(dataptr);
}
u8_t pbuf_get_at(struct pbuf* p, u16_t offset)
{
  __coverity_tainted_data_return__();
}

void abort(void)
{
  __coverity_panic__();
}

int check_path(char* path, size_t size)
{
  if (size) {
    __coverity_tainted_data_sanitize__(path);
    return 1;
  } else {
    return 0;
  }
}