Skip to content
Snippets Groups Projects
Select Git revision
  • pu
  • passt default
  • master
  • todo
  • next
  • maint
  • v2.8.0-rc1
  • v2.8.0-rc0
  • v2.7.2
  • v2.7.1
  • v2.7.0
  • v2.6.5
  • v2.7.0-rc3
  • v2.7.0-rc2
  • v2.7.0-rc1
  • v2.7.0-rc0
  • v2.6.4
  • v2.6.3
  • v2.6.2
  • v2.6.1
  • v2.3.10
  • v2.5.4
  • v2.4.10
  • v2.6.0
  • v2.6.0-rc3
  • v2.5.3
26 results

csum-file.c

Blame
    • Jeff King's avatar
      599d2231
      sha1fd_check: die when we cannot open the file · 599d2231
      Jeff King authored
      
      Right now we return a NULL "struct sha1file" if we encounter
      an error. However, the sole caller (write_idx_file) does not
      check the return value, and will segfault if we hit this
      case.
      
      One option would be to handle the error in the caller.
      However, there's really nothing for it to do but die. This
      code path is hit during "git index-pack --verify"; after we
      verify the packfile, we check that the ".idx" we would
      generate from it is byte-wise identical to what is on disk.
      We hit the error (and segfault) if we can't open the .idx
      file (a likely cause of this is that somebody else ran "git
      repack -ad" while we were verifying). Since we can't
      complete the requested verification, we really have no
      choice but to die.
      
      Furthermore, the rest of the sha1fd_* functions simply die
      on errors. So if were to open the file successfully, for
      example, and then hit a read error, sha1write would call
      die() for us. So pushing the die() down into sha1fd_check
      keeps the interface consistent.
      
      Signed-off-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      599d2231
      History
      sha1fd_check: die when we cannot open the file
      Jeff King authored
      
      Right now we return a NULL "struct sha1file" if we encounter
      an error. However, the sole caller (write_idx_file) does not
      check the return value, and will segfault if we hit this
      case.
      
      One option would be to handle the error in the caller.
      However, there's really nothing for it to do but die. This
      code path is hit during "git index-pack --verify"; after we
      verify the packfile, we check that the ".idx" we would
      generate from it is byte-wise identical to what is on disk.
      We hit the error (and segfault) if we can't open the .idx
      file (a likely cause of this is that somebody else ran "git
      repack -ad" while we were verifying). Since we can't
      complete the requested verification, we really have no
      choice but to die.
      
      Furthermore, the rest of the sha1fd_* functions simply die
      on errors. So if were to open the file successfully, for
      example, and then hit a read error, sha1write would call
      die() for us. So pushing the die() down into sha1fd_check
      keeps the interface consistent.
      
      Signed-off-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    Kconfig 555 B
    # SPDX-License-Identifier: GPL-2.0
    #
    # For a description of the syntax of this configuration file,
    # see Documentation/kbuild/kconfig-language.rst.
    #
    mainmenu "Linux/$(ARCH) $(KERNELVERSION) Kernel Configuration"
    
    source "scripts/Kconfig.include"
    
    source "init/Kconfig"
    
    source "kernel/Kconfig.freezer"
    
    source "fs/Kconfig.binfmt"
    
    source "mm/Kconfig"
    
    source "net/Kconfig"
    
    source "drivers/Kconfig"
    
    source "fs/Kconfig"
    
    source "security/Kconfig"
    
    source "crypto/Kconfig"
    
    source "lib/Kconfig"
    
    source "lib/Kconfig.debug"
    
    source "Documentation/Kconfig"