andrew-d / andrew-d/snappy-go

Decode panics when passed malformed input

未關閉
#7 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
auto-migrated Priority-Medium Type-Defect
主要語言
Go
星號
0
分支
0
PR 合併指標
30 天內沒有已合併 PR

描述

```
What steps will reproduce the problem?

Call snappy.Decode(nil, x) where x has the form 0xff 0xff 0xff 0xff ... 0xff
0x00. The function call issues a runtime panic.

What is the expected output? What do you see instead?

No panic and a non-nil error returned, "snappy: corrupt input" or something
reasonable. This is the behavior if the input has fewer than five 0xff bytes.

What version of the product are you using? On what operating system?

Revision 12e4b4183793 (go1.3.1-linux-amd64)

Please provide any additional information below.

There seem to be panics in three different locations, depending on the length
of the input. I put together a gist showing the lengths at which each different
panic occurs.

https://gist.github.com/bmatsuo/2cad6e15c1e3a04d9879

I'm not actually positive these inputs are invalid by the spec. I just stumbled
into them testing behavior of "github.com/mreiferson/go-snappystream" when
decoding junk input.
```

Original issue reported on code.google.com by `bryan.matsuo` on 8 Sep 2014 at 2:11

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。