bostic (AT) sleepycat (DOT) com writes:
Quote:
That approach requires a change in the Berkeley DB db_strerror API (or
a new API, db_strerror_r, I suppose). Is there enough risk here to
make an API change necessary? |
I think that the possibility of inadvertant unbounded memory reads
would be something that needs fixing even if it is rather unlikely.
But, looking at the code (unknown_err: in common/db_err.c), I find
that there really isn't such a problem. There will always be some
\0 before the end of ebuf[], unless int becomes larger than 64 bit,
and snprintf is broken.
So this leaves a problem of error message accuracy, and only for the
case where two threads output a different and unknown error code.
This is probably not a very urgent concern.
However, if in the real world use of strerror_r over strerror
is becoming the norm, adding db_strerror_r (while keeping
db_strerror) would be a good thing. People will be pleasantly
surprised to find what they expect.
best regards
Patrick