[Spice-devel] BUG? NULL pointer check in quic_encode, but quic_encode is always called with a NULL

Alon Levy alevy at redhat.com
Wed Mar 28 02:43:13 PDT 2012


On Tue, Mar 27, 2012 at 05:01:12PM -0400, Nahum Shalman wrote:
> Hey everyone, I think I found a bug:
> 
> I've been living on the bleeding edge of the spice repos and a vm I
> was running was tripping over
> quic.c line 1242 (lots of errors spewing on the console).
> 
> It looks like a sane check for NULL pointers in the quic_encode function:
> 1241    if (line == NULL) {
> 1242        spice_warn_if_reached();
> 1243        return QUIC_ERROR;
> 1244    }
> 
> The only problem is that the *only* call to quic_encode in the spice
> server...
> 
> ~/spice $ git grep -n quic_encode
> server/red_worker.c:6119:    size = quic_encode(quic, type, src->x,
> src->y, NULL, 0, stride,
> 
> *calls it with a NULL* !?
> 
> git blame points at c1403ee6bf4dfdd8f614f84ef145083b06a9f23e so I'm
> CC'ing the author.
> 
> I think that either the NULL pointer check is wrong, or that
> red_worker shouldn't be passing a NULL to quic_encode...
> but I'm not sure which is the case.

I think we talked about it in irc, and the NULL pointer passing is
correct (if only because it's always been this way), and the warning
should go away.

> 
> Thanks!
> -Nahum
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list