Page 1 of 1

Bug to view an internal cmd.exe buffer

Posted: 07 Nov 2012 06:14
by jeb
I recover and retest an old cmd.exe bug and it still works on win7.

It can show parts of one internal buffer which is used by cmd.exe while parsing the lines.

Code: Select all

@echo off
set var=12345
rem abcdef%var%ghijklmnopqrstuvw
set new=ABC
..^
%~

Die folgende Verwendung des Pfadoperators zur Ersetzung eines Batchparameters
ist ungültig: %~


Geben Sie CALL /? oder FOR /? ein, um herauszufinden, welche Formate gültig
sind.
"..ew=ABC" kann syntaktisch an dieser Stelle nicht verarbeitet werden.

But adding some dots or any other character will show another part of the buffer.

Code: Select all

@echo off
set var=12345
rem abcdef%var%ghijklmnopqrstuvw
set new=ABC
.........^
%~


Will show
Die folgende Verwendung des Pfadoperators zur Ersetzung eines Batchparameters
ist ungültig: %~


Geben Sie CALL /? oder FOR /? ein, um herauszufinden, welche Formate gültig
sind.
".........345ghijklmnopqrstuvw" kann syntaktisch an dieser Stelle nicht verarbeitet werden.


It seems that the buffer will be filled and a NULL character terminates the current buffer,
but the buffer will never cleared, so longer command lines are still present.

jeb