From 008ffb81c136cb3d4c2dd1bab8ae5fb169a68dd5 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 29 Aug 2023 10:57:00 +0100 Subject: [PATCH] Also for the SELECT --- state/device_data_table.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/state/device_data_table.go b/state/device_data_table.go index a024304c..cd9fc34b 100644 --- a/state/device_data_table.go +++ b/state/device_data_table.go @@ -55,7 +55,14 @@ func (t *DeviceDataTable) Select(userID, deviceID string, swap bool) (result *in return err } // unmarshal to swap - if err = cbor.Unmarshal(row.Data, &result); err != nil { + opts := cbor.DecOptions{ + MaxMapPairs: 1000000000, // 1 billion :( + } + decMode, err := opts.DecMode() + if err != nil { + return err + } + if err = decMode.Unmarshal(row.Data, &result); err != nil { return err } result.UserID = userID