kappa-db / multifeed

Multi-writer hypercore.
136 stars 27 forks source link

callee of deserializeHeader() doesn't handle error #11

Closed ralphtheninja closed 5 years ago

ralphtheninja commented 5 years ago

deserializeHeader() might return an Error if json is borked, but this it not taken care of by the callee.

https://github.com/noffle/multifeed/blob/3d2e999454363d3e123504efee57188ec862bf91/index.js#L291-L303

https://github.com/noffle/multifeed/blob/3d2e999454363d3e123504efee57188ec862bf91/index.js#L211-L231

ralphtheninja commented 5 years ago

We could just return null from deserializeHeader() and the callee should bail unless header is ok.

ralphtheninja commented 5 years ago

I'm guessing we assume that the header contains both header.version and header.keys?

hackergrrl commented 5 years ago

fixed in 2.0.4