Skip to contentSkip to conversation

coverity: update model for latest tools

PATCH New Paolo Bonzini 1 participant 1 message Mar 31, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 coverity: update model for latest tools

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.

---
 scripts/coverity-scan/model.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/coverity-scan/model.c +2 -1
index 9d4fba53d9..686d1a3008 100644
@@ -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;
 }
Signature · 1 line
2.35.1