Skip to content

Commit

Permalink
Merge pull request #96 from k1LoW/fix-null-pointer
Browse files Browse the repository at this point in the history
Fix null pointer dereference
  • Loading branch information
k1LoW committed Sep 7, 2021
2 parents 3d2aeef + 073d6f2 commit d7072a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ifeq ($(OSNAME),Darwin)
export GOMPLATE_OS=darwin
else
export LO = lo
export MYSQL_DISABLE_SSL = --skip-ssl
export MYSQL_DISABLE_SSL = --ssl-mode=DISABLED
export GOMPLATE_OS=linux
endif

Expand Down
6 changes: 6 additions & 0 deletions reader/payload_buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ func (p *payloadBuffer) Get(direction dumper.Direction) []byte {
}

func (p *payloadBuffer) Delete(direction dumper.Direction) {
if p == nil {
return
}
p.updateExpires()
switch direction {
case dumper.SrcToDst:
Expand All @@ -76,6 +79,9 @@ func (p *payloadBuffer) Delete(direction dumper.Direction) {
}

func (p *payloadBuffer) Append(direction dumper.Direction, in []byte) {
if p == nil {
return
}
p.updateExpires()
switch direction {
case dumper.SrcToDst:
Expand Down

0 comments on commit d7072a4

Please sign in to comment.