Skip to content
Snippets Groups Projects
  1. Oct 03, 2023
  2. Sep 29, 2023
  3. Sep 15, 2023
  4. Sep 11, 2023
  5. Sep 08, 2023
  6. Aug 31, 2023
  7. Jul 25, 2023
    • Akihiko Odaki's avatar
      crypto: Always initialize splitkeylen · 55a01cab
      Akihiko Odaki authored
      
      When _FORTIFY_SOURCE=2, glibc version is 2.35, and GCC version is
      12.1.0, the compiler complains as follows:
      
      In file included from /usr/include/string.h:535,
                       from /home/alarm/q/var/qemu/include/qemu/osdep.h:99,
                       from ../crypto/block-luks.c:21:
      In function 'memset',
          inlined from 'qcrypto_block_luks_store_key' at ../crypto/block-luks.c:843:9:
      /usr/include/bits/string_fortified.h:59:10: error: 'splitkeylen' may be used uninitialized [-Werror=maybe-uninitialized]
         59 |   return __builtin___memset_chk (__dest, __ch, __len,
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         60 |                                  __glibc_objsize0 (__dest));
            |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
      ../crypto/block-luks.c: In function 'qcrypto_block_luks_store_key':
      ../crypto/block-luks.c:699:12: note: 'splitkeylen' was declared here
        699 |     size_t splitkeylen;
            |            ^~~~~~~~~~~
      
      It seems the compiler cannot see that splitkeylen will not be used
      when splitkey is NULL. Suppress the warning by initializing splitkeylen
      even when splitkey stays NULL.
      
      Signed-off-by: default avatarAkihiko Odaki <akihiko.odaki@daynix.com>
      Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      55a01cab
  8. Jul 09, 2023
  9. Jul 08, 2023
  10. Mar 13, 2023
  11. Feb 15, 2023
  12. Feb 08, 2023
  13. Jan 19, 2023
  14. Dec 14, 2022
  15. Nov 02, 2022
  16. Oct 27, 2022
Loading