ibmswtpm2/ibmswtpm2-NVDynamic-Fix-use-of-uninitialized-value.patch
Michal Suchanek 39f0308cd8 Accepting request 1130291 from home:michals
- Update to version 164-2020-192.2
  * Implement the RSA 5 primes optimization.
  * Check command size for int32 overflow.
  * Add support for OpenSSL 3.1.x
  * Do not accept a NULL signKey in TPM2_CertifyX509
  * Add Nuvoton to gcc makefile
- New project URL - move to github
- Drop usptreamed ibmswtpm2-OpenSSL-3.1.patch

- drop ibmswtpm2-fix-ppc32.patch (upstream)

OBS-URL: https://build.opensuse.org/request/show/1130291
OBS-URL: https://build.opensuse.org/package/show/security/ibmswtpm2?expand=0&rev=30
2023-12-01 16:04:22 +00:00

35 lines
980 B
Diff

From 8c160d2c7a17eb842fae82de3638b834976f2aa2 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Thu, 20 Aug 2020 16:42:54 +0200
Subject: [PATCH] NVDynamic: Fix use of uninitialized value.
There is a theoretical possibility that the cycle in NvNextByType does
not run at all because NvNext fails immediately and never sets nvHandle.
The cycle only runs and nvHandle is set on non-zero addr, and in that
case addr remains non-zero when breaking out of the cycle.
Use nvHandle only when addr is non-zero.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
src/NVDynamic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/NVDynamic.c b/src/NVDynamic.c
index 8ede9e4..535ea03 100644
--- a/src/NVDynamic.c
+++ b/src/NVDynamic.c
@@ -122,7 +122,7 @@ NvNextByType(
if(HandleGetType(nvHandle) == type)
break;
}
- if(handle != NULL)
+ if(addr && (handle != NULL))
*handle = nvHandle;
return addr;
}
--
2.42.0