sketches-go icon indicating copy to clipboard operation
sketches-go copied to clipboard

[bug] panic, runtime: out of memory when decoding crafted payload

Open edznux-dd opened this issue 6 months ago • 0 comments

The following payload will cause the program to try to allocate a huge (833254811566 floats64) slice. Which correspond to 6.6+ terabytes. The payload was found with the fuzzer proposed in this PR.

func TestRegression(t *testing.T) {
	_, _ = DecodeDDSketch([]byte("\x0f\x0f\u06dd\u06dd\xd0000"), store.DenseStoreConstructor, nil)
}

Note: At first glance, it looks like the getNewLength() should use a uint as well?

Image

edznux-dd avatar Jun 27 '25 18:06 edznux-dd