3 ms·
Making sds a typedef for char* is very convenient. But it makes it very easy to pass an sds to a function that expects a C string without checking for null byte
by vvde 13y ago
Making sds a typedef for char* is very convenient. But it makes it very easy to pass an sds to a function that expects a C string without checking for null bytes.
Ruby, Java, Perl, PHP have all had security problems when interacting with C because they failed to properly distinguish binary-safe strings and C strings.
http://insecure.org/news/P55-07.txt http://insecure.org/news/P55-07.txt
http://cwe.mitre.org/data/definitions/626.html http://cwe.mitre.org/data/definitions/626.html
- kzrdude 13y agoI'd prefer a typesafe version (that would be a library with a struct type). It could even be a trivial wrapper struct for the char *.