mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-22 07:42:02 +00:00
fix out of range access to string
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9914 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
ce8abc8a33
commit
63ebe9def7
@ -1,3 +1,7 @@
|
||||
2005-05-06 José Matos <jamatos@lyx.org>
|
||||
|
||||
* insetcommandparams.C (scanCommand): fix out of range string access.
|
||||
|
||||
2005-05-05 Martin Vermeer <martin.vermeer@hut.fi>
|
||||
|
||||
* insetbibitem.C (bibitemMaxWidth): removed as obsolete
|
||||
|
@ -46,8 +46,7 @@ void InsetCommandParams::scanCommand(string const & cmd)
|
||||
int nestdepth = 0;
|
||||
|
||||
for (string::size_type i = 0; i < cmd.length(); ++i) {
|
||||
char c = cmd[i];
|
||||
char b = cmd[i-1];
|
||||
char const c = cmd[i];
|
||||
if ((state == CMDNAME && c == ' ') ||
|
||||
(state == CMDNAME && c == '[') ||
|
||||
(state == CMDNAME && c == '{')) {
|
||||
@ -72,7 +71,8 @@ void InsetCommandParams::scanCommand(string const & cmd)
|
||||
case OPTION: toptions += c; break;
|
||||
case SECOPTION: tsecoptions += c; break;
|
||||
case CONTENT: tcontents += c; break;
|
||||
case WS:
|
||||
case WS: {
|
||||
char const b = i? cmd[i-1]: 0;
|
||||
if (c == '\\') {
|
||||
state = CMDNAME;
|
||||
} else if (c == '[' && b != ']') {
|
||||
@ -87,6 +87,7 @@ void InsetCommandParams::scanCommand(string const & cmd)
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Don't mess with this.
|
||||
|
Loading…
x
Reference in New Issue
Block a user