mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
Prevent endless loop in error case.
This commit is contained in:
parent
43cb89f546
commit
527f3d2bc7
@ -69,6 +69,9 @@ class WasmOutputStream extends FilterOutputStream {
|
|||||||
* if an I/O error occurs.
|
* if an I/O error occurs.
|
||||||
*/
|
*/
|
||||||
void writeVaruint32( @Nonnegative int value ) throws IOException {
|
void writeVaruint32( @Nonnegative int value ) throws IOException {
|
||||||
|
if( value < 0 ) {
|
||||||
|
throw new IOException( "Invalid negative value" );
|
||||||
|
}
|
||||||
do {
|
do {
|
||||||
int b = value & 0x7F; // low 7 bits
|
int b = value & 0x7F; // low 7 bits
|
||||||
value >>= 7;
|
value >>= 7;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user