Hey,
I believe the check here: https://github.com/conformal/backtrace/blob/master/libbacktrace/backtrace.c#L264
should in fact be:
if (csz >= sz - (current - (char *)rv)) {
...
}
Currently, as written, the condition can't ever be true because strlcpy() unless line[x] was not properly NULL terminated (e.g. runaway string), but you probably wanted to check if strlcpy() was able to fit the whole line[i] inside the cur buffer.
Hey,
I believe the check here: https://github.com/conformal/backtrace/blob/master/libbacktrace/backtrace.c#L264
should in fact be:
Currently, as written, the condition can't ever be true because
strlcpy()unlessline[x]was not properlyNULLterminated (e.g. runaway string), but you probably wanted to check ifstrlcpy()was able to fit the wholeline[i]inside thecurbuffer.