On 8/10/19 8:02 AM, Richard W.M. Jones wrote:
> In the generated wrapper code this adds checks for all Enum
> parameters.  Since only nbd_set_tls uses an Enum parameter, the only
> extra code generated by this change is:
> 
>   int
>   nbd_set_tls (struct nbd_handle *h, int tls) {
>     // ...
>     switch (tls) {
>     case LIBNBD_TLS_DISABLE:
>     case LIBNBD_TLS_ALLOW:
>     case LIBNBD_TLS_REQUIRE:
>       break;
>     default:
>       set_error (EINVAL, "%s: invalid value for parameter: %d",
>                  "tls", tls);
>       ret = -1;
>       goto out;
>     }
> 
> This doesn't change the C API, but previously this parameter was not
> checked.  So programs using this API which previously happened to work
> would now get an error.

programs using this API with an out-of-bounds value

(it doesn't change programs using it as documented)

> ---
>  generator/generator | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 

ACK.

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

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Libguestfs mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to