qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Qemu-block] [PATCH] block: curl: Allow passing cookies


From: Eric Blake
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block: curl: Allow passing cookies via QCryptoSecret
Date: Tue, 9 May 2017 14:52:38 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 05/09/2017 02:43 PM, Manos Pitsidianakis wrote:
> On Thu, May 04, 2017 at 04:00:06PM +0200, Peter Krempa wrote:
>> +    cookie_secret = qemu_opt_get(opts, CURL_BLOCK_OPT_COOKIE_SECRET);
>> +
>> +    if (cookie && cookie_secret) {
>> +        error_setg(errp,
>> +                   "curl driver cannot handle both cookie and cookie
>> secret");
>> +        goto out_noclean;
>> +    }
>> +
>> +    if (cookie_secret) {
>> +        s->cookie = qcrypto_secret_lookup_as_utf8(cookie_secret, errp);
>> +        if (!s->cookie) {
>> +            goto out_noclean;
>> +        }
>> +    } else {
>> +        s->cookie = g_strdup(cookie);
>> +    }
> 
> There's no check here for if both cookie and cookie_secret are NULL.

Is that a problem?  s->cookie ends up as NULL (thanks to g_strdup()
semantics), which merely means there's no cookie to be sent after all.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]