2 ms·
I'm not saying you need to fully validate the database, but at least making sure the row you're about to read can actually fit in the buffer you just allocated
by zeta0134 10y ago
I'm not saying you need to fully validate the database, but at least making sure the row you're about to read can actually fit in the buffer you just allocated would be a good practice, even if the input validation shouldn't normally allow it.
If the database could theoretically hold it according to its schema, the program should be prepared for the largest row size that is still technically legal. (Where "prepared" may simply mean that it throws a "This should never happen" error and aborts the request.)