On 02/03/20 02:58, Julio Faracco wrote:
> Sorry my ignorance, Paolo.
> But why should I remove MAX_{VM,VCPU}_ID?
> 
> Did you mean that check?
>     if (vm_id > MAX_VM_ID || vcpu_id > MAX_VCPU_ID) {
>         fprintf(stderr, "Too big vm id %x or vcpu id %x\n", vm_id, vcpu_id);
>         return NULL;
>     }
> 
> Wouldn't it be dangerous?

No, the check is only needed to avoid the buffer truncation from
snprintf.  If you use g_strdup_printf it's not needed anymore because
there can be no truncation.

Paolo


Reply via email to