2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 19:08:55 +00:00
restic/internal/backend
Michael Pratt 9537bc561d gs: fix nil dereference
info can be nil if err != nil, resulting in a nil dereference while
logging:

$ # GCS config
$ ./restic init
debug enabled
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x935947]

goroutine 1 [running]:
github.com/restic/restic/internal/backend/gs.(*Backend).Save(0xc420012690, 0xe84e80, 0xc420010448, 0xb57149, 0x3, 0xc4203fc140, 0x40, 0xe7be40, 0xc4201d8f90, 0xa0, ...)
	src/github.com/restic/restic/internal/backend/gs/gs.go:226 +0x6d7
github.com/restic/restic/internal/repository.AddKey(0xe84e80, 0xc420010448, 0xc4202f0360, 0xc42000a1b0, 0x4, 0x0, 0xa55b60, 0xc4203043e0, 0xa55420)
	src/github.com/restic/restic/internal/repository/key.go:235 +0x4a1
github.com/restic/restic/internal/repository.createMasterKey(0xc4202f0360, 0xc42000a1b0, 0x4, 0xa55420, 0xc420304370, 0x6a6070)
	src/github.com/restic/restic/internal/repository/key.go:62 +0x60
github.com/restic/restic/internal/repository.(*Repository).init(0xc4202f0360, 0xe84e80, 0xc420010448, 0xc42000a1b0, 0x4, 0x1, 0xc42030a440, 0x40, 0x32a4573d3d9eb5, 0x0, ...)
	src/github.com/restic/restic/internal/repository/repository.go:403 +0x5d
github.com/restic/restic/internal/repository.(*Repository).Init(0xc4202f0360, 0xe84e80, 0xc420010448, 0xc42000a1b0, 0x4, 0xe84e40, 0xc42004ad80)
	src/github.com/restic/restic/internal/repository/repository.go:397 +0x12c
main.runInit(0xc420018072, 0x16, 0x0, 0x0, 0x0, 0xe84e40, 0xc42004ad80, 0xc42000a1b0, 0x4, 0xe7dac0, ...)
	src/github.com/restic/restic/cmd/restic/cmd_init.go:47 +0x2a4
main.glob..func9(0xeb5000, 0xedad70, 0x0, 0x0, 0x0, 0x0)
	src/github.com/restic/restic/cmd/restic/cmd_init.go:20 +0x8e
github.com/restic/restic/vendor/github.com/spf13/cobra.(*Command).execute(0xeb5000, 0xedad70, 0x0, 0x0, 0xeb5000, 0xedad70)
	src/github.com/restic/restic/vendor/github.com/spf13/cobra/command.go:649 +0x457
github.com/restic/restic/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xeb3e00, 0xc420011650, 0xa55b60, 0xc420011660)
	src/github.com/restic/restic/vendor/github.com/spf13/cobra/command.go:728 +0x339
github.com/restic/restic/vendor/github.com/spf13/cobra.(*Command).Execute(0xeb3e00, 0x25, 0xc4201a7eb8)
	src/github.com/restic/restic/vendor/github.com/spf13/cobra/command.go:687 +0x2b
main.main()
	src/github.com/restic/restic/cmd/restic/main.go:72 +0x268

(The error was likely because I had just enabled the GCS API. Subsequent
runs were fine.)
2017-08-27 21:36:04 -07:00
..
azure azure: Rework path initialization 2017-08-06 21:47:04 +02:00
b2 Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
gs gs: fix nil dereference 2017-08-27 21:36:04 -07:00
local Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
location Merge pull request #1149 from restic/azure-support 2017-08-09 21:30:35 +02:00
mem Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
rest Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
s3 Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
sftp Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
swift Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
test Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
testdata Moves files 2017-07-23 14:19:13 +02:00
doc.go Moves files 2017-07-23 14:19:13 +02:00
http_transport.go Run goimports 2017-07-23 14:21:03 +02:00
layout_default.go Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
layout_rest.go Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
layout_s3legacy.go Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
layout_test.go Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
layout.go Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
paths.go Moves files 2017-07-23 14:19:13 +02:00
semaphore.go Run goimports 2017-07-23 14:21:03 +02:00
utils_test.go Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
utils.go Move restic package to internal/restic 2017-07-24 17:43:32 +02:00