Emurgo / csl-mobile-bridge

React-native bindings for Emurgo's cardano-serialization-lib (Cardano haskell Shelley)
MIT License
23 stars 12 forks source link

[3.1.2] Replaced `Long.parseLong` with `BigInteger.longValue` #51

Closed vsubhuman closed 2 years ago

vsubhuman commented 2 years ago

Long.toHexString produces 2-complement format for negative values and cannot be used securely with Long.parseLong(16) which cannot process 2-complement and expects a weird optional negative sign in front of a hex value. These two should never be used together, and ideally parseLong(16) should not be used at all, unless in a strictly bounded context. RPtr is used to store memory pointers and on 64-bit devices it is not bounded in any way and values can occupy the entire range of 64 long bits.

vsubhuman commented 2 years ago

Published: https://www.npmjs.com/package/@emurgo/react-native-haskell-shelley/v/3.1.2

vsubhuman commented 2 years ago

Release: https://github.com/Emurgo/react-native-haskell-shelley/releases/tag/3.1.2