From 905840b70eb14ee0cf7c583ca3c61b5b9ef5bd54 Mon Sep 17 00:00:00 2001 From: jholdstock Date: Tue, 9 Jul 2024 14:33:20 +0100 Subject: [PATCH] vsp: Prevent nil pointer dereference. Previously was checking if fp == nil and then attempting to access fp. --- vsp/vsp.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vsp/vsp.go b/vsp/vsp.go index 0975932f5..8902339ff 100644 --- a/vsp/vsp.go +++ b/vsp/vsp.go @@ -219,7 +219,7 @@ func (c *Client) Process(ctx context.Context, ticket *wallet.VSPTicket, feeTx *w // transaction, submit it then confirm. fp := c.feePayment(ctx, ticket, false) if fp == nil { - err := fp.ticket.UpdateFeeErrored(ctx, c.Client.URL, c.Client.PubKey) + err := ticket.UpdateFeeErrored(ctx, c.Client.URL, c.Client.PubKey) if err != nil { return err } @@ -232,7 +232,7 @@ func (c *Client) Process(ctx context.Context, ticket *wallet.VSPTicket, feeTx *w fp.mu.Unlock() err := fp.receiveFeeAddress() if err != nil { - err := fp.ticket.UpdateFeeErrored(ctx, c.Client.URL, c.Client.PubKey) + err := ticket.UpdateFeeErrored(ctx, c.Client.URL, c.Client.PubKey) if err != nil { return err } @@ -243,7 +243,7 @@ func (c *Client) Process(ctx context.Context, ticket *wallet.VSPTicket, feeTx *w } err = fp.makeFeeTx(feeTx) if err != nil { - err := fp.ticket.UpdateFeeErrored(ctx, c.Client.URL, c.Client.PubKey) + err := ticket.UpdateFeeErrored(ctx, c.Client.URL, c.Client.PubKey) if err != nil { return err }