Skip to content

Commit

Permalink
Also for the SELECT
Browse files Browse the repository at this point in the history
  • Loading branch information
kegsay committed Aug 29, 2023
1 parent 073c847 commit 008ffb8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion state/device_data_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 008ffb8

Please sign in to comment.