From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLcDq-00028e-Dv for qemu-devel@nongnu.org; Wed, 11 Feb 2015 13:41:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLcDl-0005tR-Br for qemu-devel@nongnu.org; Wed, 11 Feb 2015 13:41:14 -0500 Received: from mail-wg0-x231.google.com ([2a00:1450:400c:c00::231]:51853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLcDl-0005tJ-5L for qemu-devel@nongnu.org; Wed, 11 Feb 2015 13:41:09 -0500 Received: by mail-wg0-f49.google.com with SMTP id l18so5333557wgh.8 for ; Wed, 11 Feb 2015 10:41:08 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54DBA23F.6050409@redhat.com> Date: Wed, 11 Feb 2015 19:41:03 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1423153463-26494-1-git-send-email-armbru@redhat.com> <1423153463-26494-3-git-send-email-armbru@redhat.com> In-Reply-To: <1423153463-26494-3-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 2/4] coverity: Model GLib string allocation partially List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org On 05/02/2015 17:24, Markus Armbruster wrote: > + > +char *g_strdup(const char *s) > +{ > + char *dup; > + size_t i; > + > + if (!s) { > + return NULL; > + } > + > + __coverity_string_null_sink__(s); > + __coverity_string_size_sink__(s); What's __coverity_string_size_sink__? It is likely responsible for this in libcacard: Unbounded source buffer (STRING_SIZE) string_size: Passing string argv[argc - 2] of unknown size to g_strdup, which expects a string of a particular size I guess it's okay to mark this as intentional? > > +char *g_strndup(const char *s, size_t n) > +{ > + char *dup; > + size_t i; > + > + __coverity_negative_sink__(n); > + > + if (!s) { > + return NULL; > + } > + > + dup = g_malloc(n + 1); This should be g_malloc0 I think. Paolo