mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +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.
|
||||
*/
|
||||
void writeVaruint32( @Nonnegative int value ) throws IOException {
|
||||
if( value < 0 ) {
|
||||
throw new IOException( "Invalid negative value" );
|
||||
}
|
||||
do {
|
||||
int b = value & 0x7F; // low 7 bits
|
||||
value >>= 7;
|
||||
|
Loading…
x
Reference in New Issue
Block a user