scylladb / scylla-go-driver

Experimental, high performance Scylla Driver, University of Warsaw students' project
Apache License 2.0
151 stars 7 forks source link

Add fuzz tests in cqlvalue with random data #272

Open martin-sucha opened 2 years ago

martin-sucha commented 2 years ago

Currently fuzz tests for CQL values like FuzzCqlValueInt32 test that data == deserialize(serialize(data)). However, these kinds of tests are unlikely to find issues like panics because of missing bounds checks when parsing data, since they only try to parse valid data.

For example, CqlValue.AsStringMap seems that it will panic if the CQLValue.Value field does not have enough bytes (although I haven't tried running the function yet).

Consider adding fuzz tests that do deserialize(random bytes) and test that the parsing functions never panic for cql values as well.