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

Fix #1948: enc_message may be used uninitialized in p11test_case_ps… #1958

Closed
wants to merge 1 commit into from
Closed

Conversation

kloczek
Copy link

@kloczek kloczek commented Feb 22, 2020

…s_oaep.c

#1948

p11test_case_pss_oaep.c: In function 'pss_oaep_test':
p11test_case_pss_oaep.c:424:2: error: 'enc_message' may be used uninitialized in this function [-Werror=maybe-uninitialized]
424 | free(enc_message);
| ^

This is warning but it is treated as error.

Checklist
  • Documentation is added or updated
  • New files have a LGPL 2.1 license statement
  • PKCS#11 module is tested
  • Windows minidriver is tested
  • macOS tokend is tested

…s_oaep.c

#1948

p11test_case_pss_oaep.c: In function 'pss_oaep_test':
p11test_case_pss_oaep.c:424:2: error: 'enc_message' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  424 |  free(enc_message);
      |  ^

This is warning but it is treated as error.
@@ -376,7 +376,7 @@ int oaep_encrypt_decrypt_test(test_cert_t *o, token_info_t *info, test_mech_t *m
CK_BYTE *dec_message = NULL;
int dec_message_length = 0;
int message_length = 16;
unsigned char *enc_message;
unsigned char *enc_message = 0;
Copy link
Member

Choose a reason for hiding this comment

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

Please, use NULL here as it is pointer, not integer.

@kloczek
Copy link
Author

kloczek commented Feb 25, 2020

Confirmed.

That solved that warning.

Copy link
Member

@frankmorgner frankmorgner left a comment

Choose a reason for hiding this comment

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

Please, use NULL here as it is pointer, not integer.

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.

None yet

3 participants