mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 03:11:59 +00:00
Only accept non-negative lyxscale parameters
Since lyxscale is unsigned, a negative value would lead to a very large positive value. Spotted by coverity.
This commit is contained in:
parent
50060053e3
commit
7d4b8b7606
@ -296,10 +296,16 @@ bool InsetExternalParams::read(Buffer const & buffer, Lexer & lex)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EX_LYXSCALE:
|
case EX_LYXSCALE: {
|
||||||
lex.next();
|
lex.next();
|
||||||
lyxscale = lex.getInteger();
|
int const ls = lex.getInteger();
|
||||||
|
// negative values are not accepted.
|
||||||
|
if (ls >= 0)
|
||||||
|
lyxscale = ls;
|
||||||
|
else
|
||||||
|
lex.printError("ExternalInset::read: Wrong lyxscale: $$Token");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case EX_DRAFT:
|
case EX_DRAFT:
|
||||||
draft = true;
|
draft = true;
|
||||||
@ -379,8 +385,6 @@ bool InsetExternalParams::read(Buffer const & buffer, Lexer & lex)
|
|||||||
|
|
||||||
if (lyxerr.debugging(Debug::EXTERNAL)) {
|
if (lyxerr.debugging(Debug::EXTERNAL)) {
|
||||||
lyxerr << "InsetExternalParams::read:\n";
|
lyxerr << "InsetExternalParams::read:\n";
|
||||||
// false positive
|
|
||||||
// coverity[NEGATIVE_RETURNS]
|
|
||||||
write(buffer, lyxerr);
|
write(buffer, lyxerr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user