]> git.proxmox.com Git - swtpm.git/commitdiff
swtpm: Fix a forgotten endianess-conversion
authorStefan Berger <stefanb@linux.ibm.com>
Mon, 11 Oct 2021 20:20:46 +0000 (16:20 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Mon, 11 Oct 2021 21:50:52 +0000 (17:50 -0400)
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
src/swtpm/swtpm_nvstore_linear.c

index 91c346f467884604cf985cbcdb42386144e556be..eda779332ac8233fbe3fd4edafa3b48d49461d26 100644 (file)
@@ -364,7 +364,7 @@ SWTPM_NVRAM_StoreData_Linear(unsigned char *filedata,
             return rc;
         }
         needs_hdr_flush = TRUE;
-    } else if (filedata_length > file->section_length) {
+    } else if (filedata_length > le32toh(file->section_length)) {
         /* realloc, resize will be done by AllocFile */
         rc = SWTPM_NVRAM_Linear_RemoveFile(uri, file_nr, FALSE);
         if (rc) {