verificatum / verificatum-vjsc

NEWS! We will soon release a TypeScript transpilation and improvement of this library. Self-contained cryptographic library for use in electronic voting clients. Complete documentation with references to the literature makes it good teaching material.
https://www.verificatum.org
Other
15 stars 3 forks source link

Potential issue in error case management #1

Open vigourouxc opened 5 years ago

vigourouxc commented 5 years ago

Hi,

It seems that this line of code is broken: https://github.com/verificatum/verificatum-vjsc/blob/85eae030969ab5fe01a9448151b5b08140973e88/src/js/verificatum/arithm/PPRing.js#L279

in case the previous statement is false: https://github.com/verificatum/verificatum-vjsc/blob/85eae030969ab5fe01a9448151b5b08140973e88/src/js/verificatum/arithm/PPRing.js#L275-L279

The elements variable is not yet defined, so elements.length would result in a TypeError.