Browse Source

instead of throwing, return undefined in invalid (too short) buffers

master
Dominic Tarr 9 years ago
parent
commit
5a00978b1b
  1. 7
      decode.js

7
decode.js

@ -18,7 +18,12 @@ function read(buf, offset) {
shift += 7
} while (b >= MSB)
read.bytesRead = counter - offset
if(b === undefined) {
read.bytesRead = 0
res = undefined
}
else
read.bytesRead = counter - offset
return res
}

Loading…
Cancel
Save