Commit 7c3f3d09 authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

cmd: Don't overflow parameter length when copying substring.

parent 37035e53
......@@ -275,7 +275,7 @@ P0S
q
qwe
er
@todo_wine@'ty'@or_broken@''
'ty'@or_broken@''
't'@or_broken@''
ert@or_broken@qwerty
e@or_broken@qwerty
......
......@@ -730,6 +730,7 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start,
else if (copybytes < 0) copybytes = 0;
WCMD_strsubstW(start, endOfVar + 1, startCopy, copybytes);
} else {
substrlength = min(substrlength, len - (startCopy- thisVarContents + 1));
WCMD_strsubstW(start, endOfVar + 1, startCopy, substrlength);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment