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;
|
||||
}
|
||||
|
||||
case EX_LYXSCALE:
|
||||
case EX_LYXSCALE: {
|
||||
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;
|
||||
}
|
||||
|
||||
case EX_DRAFT:
|
||||
draft = true;
|
||||
@ -379,8 +385,6 @@ bool InsetExternalParams::read(Buffer const & buffer, Lexer & lex)
|
||||
|
||||
if (lyxerr.debugging(Debug::EXTERNAL)) {
|
||||
lyxerr << "InsetExternalParams::read:\n";
|
||||
// false positive
|
||||
// coverity[NEGATIVE_RETURNS]
|
||||
write(buffer, lyxerr);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user