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

Re: [libvirt] [PATCH] Avoid integer wrap on remotePortMax in QEMU driver



On 01/17/13 13:09, Daniel P. Berrange wrote:
> @@ -103,7 +103,7 @@ int virPortAllocatorAcquire(virPortAllocatorPtr pa,
>      *port = 0;
>      virObjectLock(pa);
>  
> -    for (i = pa->start ; i < pa->end && !*port; i++) {
> +    for (i = pa->start ; i <= pa->end && !*port; i++) {
>          int reuse = 1;
>          struct sockaddr_in addr;
>          bool used = false;

The same condition needs to be changed in virPortAllocatorRelease.
(And this breaks the virportallocatortest)


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