Bug to view an internal cmd.exe buffer

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
jeb
Expert
Posts: 1041
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Bug to view an internal cmd.exe buffer

#1 Post by jeb » 07 Nov 2012 06:14

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

Post Reply