Potential unterminated string
This commit is contained in:
@@ -420,10 +420,14 @@ naRef naParseCode(struct Context* c, naRef srcFile, int firstLine,
|
|||||||
|
|
||||||
// Catch parser errors here.
|
// Catch parser errors here.
|
||||||
p.errLine = *errLine = 1;
|
p.errLine = *errLine = 1;
|
||||||
if(setjmp(p.jumpHandle)) {
|
if (setjmp(p.jumpHandle)) {
|
||||||
strncpy(c->error, p.err, sizeof(c->error));
|
size_t end_ = sizeof(c->error) - 1;
|
||||||
|
strncpy(c->error, p.err, end_);
|
||||||
|
c->error[end_] = '\0';
|
||||||
|
|
||||||
*errLine = p.errLine;
|
*errLine = p.errLine;
|
||||||
naParseDestroy(&p);
|
naParseDestroy(&p);
|
||||||
|
|
||||||
return naNil();
|
return naNil();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user