Skip to content

Commit 24a7114

Browse files
committed
posix.cfg: Added support for encrypt()
1 parent 7df6ba4 commit 24a7114

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

cfg/posix.cfg

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,6 +1729,20 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
17291729
</arg>
17301730
<warn severity="style" reason="Obsolescent" alternatives="utimensat"/>
17311731
</function>
1732+
<!-- https://man7.org/linux/man-pages/man3/encrypt.3.html -->
1733+
<!-- void encrypt(char block[64], int edflag);-->
1734+
<function name="encrypt">
1735+
<noreturn>false</noreturn>
1736+
<leak-ignore/>
1737+
<returnValue type="void"/>
1738+
<arg nr="1" direction="in">
1739+
<not-null/>
1740+
<minsize type="value" value="64" baseType="char"/>
1741+
</arg>
1742+
<arg nr="2" direction="in">
1743+
<not-uninit/>
1744+
</arg>
1745+
</function>
17321746
<!-- int futimens(int fd, const struct timespec times[2]);-->
17331747
<function name="futimens">
17341748
<noreturn>false</noreturn>

test/cfg/posix.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,25 @@
2424
#include <netdb.h>
2525
#include <regex.h>
2626
#include <time.h>
27-
#include <unistd.h>
2827
#include <pthread.h>
2928
#include <syslog.h>
3029
#include <stdarg.h>
3130
#include <ctype.h>
3231
#include <stdbool.h>
3332
#include <mqueue.h>
3433
#define _XOPEN_SOURCE
34+
#include <unistd.h>
3535
#include <wchar.h>
3636
#include <string.h>
3737
#include <strings.h>
3838

39+
void nullPointer_encrypt(char block[64], int edflag)
40+
{
41+
// cppcheck-suppress nullPointer
42+
encrypt(NULL, edflag);
43+
encrypt(block, edflag);
44+
}
45+
3946
int nullPointer_getopt(int argc, char* const argv[], const char* optstring)
4047
{
4148
// cppcheck-suppress nullPointer

0 commit comments

Comments
 (0)