Fix compiler warnings like this detected by MinGW GCC 10 or later:

```
src/modules/module_29543.c: In function ‘module_hash_encode’:
src/modules/module_29543.c:382:18: warning: ‘key_size’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
  382 |   int line_len = snprintf (line_buf, line_size,
      "%s%s$%u$%u$%s$%s$%s",
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  383 |     SIGNATURE_LUKS,
      |     ~~~~~~~~~~~~~~~
  384 |     cipher_mode,
      |     ~~~~~~~~~~~~
  385 |     key_size,
      |     ~~~~~~~~~
  386 |     iterations,
      |     ~~~~~~~~~~~
  387 |     salt_buf,
      |     ~~~~~~~~~
  388 |     af_buf,
      |     ~~~~~~~
  389 |     ct_buf);
      |     ~~~~~~~
```

Fix is not ideal but is better than uninitialized variables.
pull/3381/head
jsteube 2 years ago
parent 37b30540ff
commit 9fe51563b1

@ -338,7 +338,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// cipher mode
char *cipher_mode;
char *cipher_mode = "";
switch (luks->cipher_mode)
{
@ -351,7 +351,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// key size
u32 key_size;
u32 key_size = 0;
switch (luks->key_size)
{

@ -318,7 +318,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// cipher mode
char *cipher_mode;
char *cipher_mode = "";
switch (luks->cipher_mode)
{
@ -331,7 +331,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// key size
u32 key_size;
u32 key_size = 0;
switch (luks->key_size)
{

@ -318,7 +318,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// cipher mode
char *cipher_mode;
char *cipher_mode = "";
switch (luks->cipher_mode)
{
@ -331,7 +331,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// key size
u32 key_size;
u32 key_size = 0;
switch (luks->key_size)
{

@ -318,7 +318,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// cipher mode
char *cipher_mode;
char *cipher_mode = "";
switch (luks->cipher_mode)
{
@ -331,7 +331,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// key size
u32 key_size;
u32 key_size = 0;
switch (luks->key_size)
{

@ -318,7 +318,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// cipher mode
char *cipher_mode;
char *cipher_mode = "";
switch (luks->cipher_mode)
{
@ -331,7 +331,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// key size
u32 key_size;
u32 key_size = 0;
switch (luks->key_size)
{

@ -318,7 +318,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// cipher mode
char *cipher_mode;
char *cipher_mode = "";
switch (luks->cipher_mode)
{
@ -331,7 +331,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// key size
u32 key_size;
u32 key_size = 0;
switch (luks->key_size)
{

@ -318,7 +318,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// cipher mode
char *cipher_mode;
char *cipher_mode = "";
switch (luks->cipher_mode)
{
@ -331,7 +331,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// key size
u32 key_size;
u32 key_size = 0;
switch (luks->key_size)
{

@ -318,7 +318,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// cipher mode
char *cipher_mode;
char *cipher_mode = "";
switch (luks->cipher_mode)
{
@ -331,7 +331,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// key size
u32 key_size;
u32 key_size = 0;
switch (luks->key_size)
{

@ -318,7 +318,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// cipher mode
char *cipher_mode;
char *cipher_mode = "";
switch (luks->cipher_mode)
{
@ -331,7 +331,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// key size
u32 key_size;
u32 key_size = 0;
switch (luks->key_size)
{

@ -318,7 +318,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// cipher mode
char *cipher_mode;
char *cipher_mode = "";
switch (luks->cipher_mode)
{
@ -331,7 +331,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// key size
u32 key_size;
u32 key_size = 0;
switch (luks->key_size)
{

@ -318,7 +318,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// cipher mode
char *cipher_mode;
char *cipher_mode = "";
switch (luks->cipher_mode)
{
@ -331,7 +331,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// key size
u32 key_size;
u32 key_size = 0;
switch (luks->key_size)
{

@ -318,7 +318,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// cipher mode
char *cipher_mode;
char *cipher_mode = "";
switch (luks->cipher_mode)
{
@ -331,7 +331,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// key size
u32 key_size;
u32 key_size = 0;
switch (luks->key_size)
{

Loading…
Cancel
Save