Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFANSI_check_enc contains bad call to 'error' that can segfault #48
Comments
|
Nice find. Do you have a link to the TERR bug? Based on my use of 'nocov' around that section of code I must have thought at the time it was hard to generate a test case that would hit that point in the code. |
|
No, there isn't an publicly visible link to the TERR bug. Part of the bug (now fixed) was that TERR was returning a bad value from getCharCE, which caused it to hit this point in the fansi code. |
|
This is now fixed in the development branch. Thanks for reporting. I'll say though I can't quite figure out how TERR managed to generate borked encoding types given that the Either way, I should have tested this code rather than assumed it was unreachable. |
FANSI_check_enc contains the code:
which has three format specifiers, and four additional arguments.
This should probably be changed to:
I discovered this due to a bug in the TERR engine, where getCharCE
produced an incorrect character encoding, leading to a call to this
'error' code, which generated a segfault. This code would probably
never be called in R, but it is worth fixing just in case.