Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tpm2_certify: fix "'type' may be used uninitialized" warning #954

Merged
merged 1 commit into from
Mar 26, 2018
Merged

tpm2_certify: fix "'type' may be used uninitialized" warning #954

merged 1 commit into from
Mar 26, 2018

Conversation

casantos
Copy link
Contributor

get_key_type does not assign a value to 'type' on error conditions,
which makes the compiler believe that it will be used uninitialized in
the LOG_ERR call, in set_scheme. In practice this will never happen
because set_scheme returns immediately if get_key_type retuns false but
the compiler does not understand that logic and fails because warnings
are treated as errors.

Signed-off-by: Carlos Santos casantos@datacom.ind.br

get_key_type does not assign a value to 'type' on error conditions,
which makes the compiler believe that it will be used uninitialized in
the LOG_ERR call, in set_scheme. In practice this will never happen
because set_scheme returns immediately if get_key_type retuns false but
the compiler does not understand that logic and fails because warnings
are treated as errors.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
woodsts pushed a commit to woodsts/buildroot that referenced this pull request Mar 25, 2018
Backport a patch alreary submitted upstream, at

  tpm2-software/tpm2-tools#954

Fixes:
  http://autobuild.buildroot.net/results/ae1e151576b365380ab711a1b8ffcd92ad0050e2
  http://autobuild.buildroot.net/results/ee80c2fe54c89589532efd47eb93bd27637c690f

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Copy link
Contributor

@martinezjavier martinezjavier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@williamcroberts williamcroberts merged commit 4a92606 into tpm2-software:master Mar 26, 2018
@casantos casantos deleted the fix-tpm2_certify branch November 15, 2018 12:44
@casantos
Copy link
Contributor Author

I noticed that this change was committed to master but did not appear in any of the subsequent 3.x.y versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants