mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 16:57:04 +00:00

Wrong: memset(&a, 0, sizeof(struct ...)); Good: memset(&a, 0, sizeof(a)); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
22 lines
289 B
Plaintext
22 lines
289 B
Plaintext
//
|
|
|
|
@@
|
|
identifier src, dst;
|
|
identifier str, len;
|
|
type t =~ "struct";
|
|
|
|
@@
|
|
|
|
(
|
|
- memset(&dst, 0, sizeof(t));
|
|
+ memset(&dst, 0, sizeof(dst));
|
|
|
|
|
- memcpy(&dst, &src, sizeof(t));
|
|
+ memcpy(&dst, &src, sizeof(dst));
|
|
|
|
|
- char str[...];
|
|
...
|
|
- memset(&str, 0, ...);
|
|
+ memset(&str, 0, sizeof(str));
|
|
)
|