]> xenbits.xensource.com Git - pvdrivers/win/xennet.git/commitdiff
Add annotation to fix SDV failure
authorOwen Smith <owen.smith@citrix.com>
Mon, 30 Jan 2023 15:03:58 +0000 (15:03 +0000)
committerPaul Durrant <pdurrant@amazon.com>
Tue, 14 Feb 2023 17:56:01 +0000 (17:56 +0000)
SDV can detect the BytesNeeded value may be 0, as it cannot determine the value
of some constants.

Signed-off-by: Alex Burke <Alex.Burke@citrix.com>
Signed-off-by: Owen Smith <owen.smith@citrix.com>
src/xennet/adapter.c

index 7a083e91b8540a346d48ab8bb339a3812683573e..4b449f3aa9edc922b78f4b24f64e3254d1b91ebb 100644 (file)
@@ -2130,6 +2130,7 @@ AdapterSetInformation(
         break;
 
     case OID_OFFLOAD_ENCAPSULATION:
+        __analysis_assume(BytesNeeded > 0);
         BytesNeeded = NDIS_SIZEOF_OFFLOAD_ENCAPSULATION_REVISION_1;
         if (BufferLength >= BytesNeeded) {
             ndisStatus = AdapterGetOffloadEncapsulation(Adapter,