Fixed FP found with daca@home: ftp://ftp.de.debian.org/debian/pool/main/i/imx-usb-loader/imx-usb-loader_0~git20200517.30b43d69.orig.tar.gz; imx_usb_loader/imx_loader_config.c:130:16: error: Invalid strncat() argument nr 2. A nul-terminated string is required. [invalidFunctionArgStr]
This commit is contained in:
parent
a59e510cdc
commit
345411a68c
|
@ -5043,7 +5043,6 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
|||
<arg nr="2" direction="in">
|
||||
<not-null/>
|
||||
<not-uninit/>
|
||||
<strz/>
|
||||
</arg>
|
||||
<arg nr="3" direction="in">
|
||||
<not-uninit/>
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
#include <stdbool.h>
|
||||
#include <mqueue.h>
|
||||
#define _XOPEN_SOURCE
|
||||
#include <wchar.h>
|
||||
#include <string.h>
|
||||
|
@ -37,6 +38,7 @@
|
|||
|
||||
int invalidFunctionArgStr_mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio)
|
||||
{
|
||||
// No warning is expected for:
|
||||
const char msg = '0';
|
||||
(void) mq_send(mqdes, &msg, 1, 0);
|
||||
return mq_send(mqdes, msg_ptr, msg_len, 0);
|
||||
|
|
|
@ -29,6 +29,16 @@
|
|||
#include <inttypes.h>
|
||||
#include <float.h>
|
||||
|
||||
void invalidFunctionArgStr_strncat(void)
|
||||
{
|
||||
char str1[20];
|
||||
strcpy (str1,"test");
|
||||
const char src = '/';
|
||||
// No warning is expected for
|
||||
strncat (str1, &src, 1);
|
||||
puts (str1);
|
||||
}
|
||||
|
||||
char * invalidFunctionArgStr_strpbrk( const char *p )
|
||||
{
|
||||
const char search[] = { -42, -43, -44 };
|
||||
|
|
Loading…
Reference in New Issue