diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2023-08-07 14:31:30 +0200 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2023-08-07 13:10:27 +0000 |
commit | dbe68128a079ee6869dc42aee37bf403e137218b (patch) | |
tree | c24b33ce1bc1ffc80f83d4989093b91472d99ab6 /modules/pam_succeed_if | |
parent | 54e97c027e52eec39220cc08b62ab480095ac5d7 (diff) | |
download | pam-dbe68128a079ee6869dc42aee37bf403e137218b.tar.gz pam-dbe68128a079ee6869dc42aee37bf403e137218b.tar.bz2 pam-dbe68128a079ee6869dc42aee37bf403e137218b.zip |
pam_env: remove allocator sizeof operator mismatch
An array of strings is allocated (into a pointer) so the single array
element to be allocated is char*.
Since sizeof(char**) should be always equal to sizeof(char*) this caused
no issues so far.
Reported by Clang analyzer:
pam_env.c:391:14: warning: Result of 'malloc' is converted to a pointer of type 'char *', which is incompatible with sizeof operand type 'char **' [unix.MallocSizeof]
391 | *lines = malloc((i + 1)* sizeof(char**));
| ^~~~~~ ~~~~~~~~~~~~~~
pam_env.c:401:13: warning: Result of 'realloc' is converted to a pointer of type 'char *', which is incompatible with sizeof operand type 'char **' [unix.MallocSizeof]
401 | tmp = realloc(*lines, (++i + 1) * sizeof(char**));
| ^~~~~~~ ~~~~~~~~~~~~~~
Diffstat (limited to 'modules/pam_succeed_if')
0 files changed, 0 insertions, 0 deletions