[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] coverity: update model for latest tools
From: |
Paolo Bonzini |
Subject: |
[PATCH] coverity: update model for latest tools |
Date: |
Thu, 31 Mar 2022 08:24:19 +0200 |
Coverity is now rejecting incomplete types in the modeling file.
Just use a random number (in the neighborhood of the actual one)
for the size of a GIOChannel.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/coverity-scan/model.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/coverity-scan/model.c b/scripts/coverity-scan/model.c
index 9d4fba53d9..686d1a3008 100644
--- a/scripts/coverity-scan/model.c
+++ b/scripts/coverity-scan/model.c
@@ -356,7 +356,8 @@ int g_poll (GPollFD *fds, unsigned nfds, int timeout)
typedef struct _GIOChannel GIOChannel;
GIOChannel *g_io_channel_unix_new(int fd)
{
- GIOChannel *c = g_malloc0(sizeof(GIOChannel));
+ /* cannot use incomplete type, the actual struct is roughly this size. */
+ GIOChannel *c = g_malloc0(20 * sizeof(void *));
__coverity_escape__(fd);
return c;
}
--
2.35.1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] coverity: update model for latest tools,
Paolo Bonzini <=