浏览代码

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.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini 3 年之前
父节点
当前提交
fae4fad5b4
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      scripts/coverity-scan/model.c

+ 2 - 1
scripts/coverity-scan/model.c

@@ -356,7 +356,8 @@ int g_poll (GPollFD *fds, unsigned nfds, int timeout)
 typedef struct _GIOChannel GIOChannel;
 typedef struct _GIOChannel GIOChannel;
 GIOChannel *g_io_channel_unix_new(int fd)
 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);
     __coverity_escape__(fd);
     return c;
     return c;
 }
 }