SHA256
1
0
forked from pool/tpm2.0-tools
tpm2.0-tools/fix_bad_bufsize.patch
Matthias Gerstner 2100671155 - add fix_bad_bufsize.patch: fixes findings from compile time fread() checks
that indicate bad buffer size specification.
- add fix_bogus_warning.patch: fixes `maybe-unitialized` warnings that are
  bogus, since the variables in questions will be initialized in any case
  later on.

OBS-URL: https://build.opensuse.org/package/show/security/tpm2.0-tools?expand=0&rev=55
2019-12-11 13:30:50 +00:00

27 lines
1.1 KiB
Diff

Index: tpm2-tools-4.1/tools/tpm2_policytemplate.c
===================================================================
--- tpm2-tools-4.1.orig/tools/tpm2_policytemplate.c
+++ tpm2-tools-4.1/tools/tpm2_policytemplate.c
@@ -23,7 +23,7 @@ static tpm2_policytemplate_ctx ctx;
static bool process_input_template_hash(char *value) {
- ctx.template_hash.size = UINT16_MAX;
+ ctx.template_hash.size = sizeof(ctx.template_hash.buffer);
bool result = files_load_bytes_from_buffer_or_file_or_stdin(NULL, value,
&ctx.template_hash.size, ctx.template_hash.buffer);
if (!result) {
Index: tpm2-tools-4.1/tools/tpm2_policynamehash.c
===================================================================
--- tpm2-tools-4.1.orig/tools/tpm2_policynamehash.c
+++ tpm2-tools-4.1/tools/tpm2_policynamehash.c
@@ -23,7 +23,7 @@ static tpm2_policynamehash_ctx ctx;
static bool process_input_name_hash(char *value) {
- ctx.name_hash.size = UINT16_MAX;
+ ctx.name_hash.size = sizeof(ctx.name_hash.buffer);
bool result = files_load_bytes_from_buffer_or_file_or_stdin(NULL, value,
&ctx.name_hash.size, ctx.name_hash.buffer);
if (!result) {