Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

CID 47537: Sizeof not portable #31

Open
mmaraya opened this issue Mar 5, 2016 · 0 comments
Open

CID 47537: Sizeof not portable #31

mmaraya opened this issue Mar 5, 2016 · 0 comments
Assignees

Comments

@mmaraya
Copy link
Owner

mmaraya commented Mar 5, 2016

ftp/glob.c#L719

suspicious_sizeof: Passing argument (cblklen(v) + 1) * 8UL /* sizeof (char **) */ to function malloc and then casting the return value to char ** is suspicious. In this particular case sizeof (char **) happens to be equal to sizeof (char *), but this is not a portable assumption.
Did you intend to use sizeof (char *) instead of sizeof (char **)?

While the program behaves correctly on the current processor architecture, it relies on potentially non-portable assumptions about type sizes. In cloneblk: The sizeof operator is used on a wrong argument that incidentally has the same size (CWE-467)

@mmaraya mmaraya self-assigned this Mar 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant