Fix #9345 FP wrongPrintfScanfArgNum for vasprintf

Configuration "<formatstr/>" for function is wrong, for the argument it
is fine.
This commit is contained in:
versat 2019-09-09 15:02:55 +02:00
parent 32eb6e1b19
commit 7737a448cf
2 changed files with 9 additions and 3 deletions

View File

@ -351,13 +351,13 @@
<arg nr="1" direction="out"> <arg nr="1" direction="out">
<not-null/> <not-null/>
</arg> </arg>
<formatstr/>
<arg nr="2" direction="in"> <arg nr="2" direction="in">
<formatstr/> <formatstr/>
<not-uninit/> <not-uninit/>
</arg> </arg>
<arg nr="3"> <arg nr="3" direction="in">
<not-uninit/> <not-uninit/>
<not-bool/>
</arg> </arg>
</function> </function>
<!-- http://man7.org/linux/man-pages/man2/accept.2.html --> <!-- http://man7.org/linux/man-pages/man2/accept.2.html -->

View File

@ -11,6 +11,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdarg.h>
#include <sys/time.h> #include <sys/time.h>
#ifndef __CYGWIN__ #ifndef __CYGWIN__
#include <sys/epoll.h> #include <sys/epoll.h>
@ -87,7 +88,7 @@ int no_resourceLeak_mkostemp_02(char *template, int flags)
return mkostemp(template, flags); return mkostemp(template, flags);
} }
void valid_code(int argInt1) void valid_code(int argInt1, va_list valist_arg)
{ {
char *p; char *p;
@ -111,6 +112,11 @@ void valid_code(int argInt1)
__builtin_prefetch(p, 0, 1); __builtin_prefetch(p, 0, 1);
if (__builtin_types_compatible_p(int, char)) {} if (__builtin_types_compatible_p(int, char)) {}
char * pStr = NULL;
if (vasprintf(&pStr, "%d %d", valist_arg) != -1) {
free(pStr);
}
} }
void ignoreleak(void) void ignoreleak(void)