From 2c7e4dcf2d137d5c3d2f1dabfb0966348029b72a Mon Sep 17 00:00:00 2001 From: jholdstock Date: Wed, 28 Aug 2024 18:03:27 +0000 Subject: [PATCH] [release-v2.0] vsp: Prevent nil pointer dereference. Previously was checking if fp == nil and then attempting to access fp. Backport of 905840b70eb14ee0cf7c583ca3c61b5b9ef5bd54. --- 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 }