[Not sure when] Editing console commands no 0x00 at end

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Rachael
Posts: 13967
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

[Not sure when] Editing console commands no 0x00 at end

Post by Rachael »

This might be tricky to reproduce but here goes.

1) Type some garbage commands into the console, 2 or 3 will work, they can be nonsensical like "dfjgrogjreorejht" and "foeroioqjwgh" (yes literally just mash the keyboard)

2) Hit the up arrow, and then left arrow a few times to edit your gibberish.

3) Hit Backspace or Del - doesn't matter, delete characters from the middle of the line.

4) Weird things start to happen - your line suddenly gets extra characters on it, the string in the edit box is not properly null-terminated.
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: [Not sure when] Editing console commands no 0x00 at end

Post by _mental_ »

In fact the string is zero terminated however it also has junk character(s) at the end.
This is not the problem of console itself but rather an issue with removal function.
I added clearing of characters beyond string's end in this PR.
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: [Not sure when] Editing console commands no 0x00 at end

Post by Edward-san »

Isn't it sufficient to just do "Chars[Len() - remlen] = 0;'?
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: [Not sure when] Editing console commands no 0x00 at end

Post by _mental_ »

Probably yes but I didn't check all other functions honestly so I made it in the safest way.
Post Reply

Return to “Closed Bugs [GZDoom]”