>>> On 26.10.17 at 19:03, <euan.har...@citrix.com> wrote:
> +static int operand_read(void *buf, struct vmx_inst_op *op,
> +                        struct cpu_user_regs *regs, unsigned int bytes)

const (twice)

> +{
> +    if ( op->type == VMX_INST_MEMREG_TYPE_REG )
> +    {
> +        switch ( bytes )
> +        {
> +        case 4:
> +            *(uint32_t *)buf = reg_read(regs, op->reg_idx);

Looking at patch 7, you leave the upper half of 64-bit variables
uninitialized here as well as in the memory case further down
when passing in a smaller value for "bytes". A decent static
analyzer should flag this, and I think things also wouldn't work
right in a few cases.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to