commit:     95914526b1e0c3482031b17c7bc8b0d1c29b3ec7
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Thu Feb 16 13:28:55 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 17 01:32:54 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=95914526

Ensure that the hard-coded ECMA-48 CSI sequence is assigned in raw form

This is necessary because format string injection no longer occurs, nor
is the %b format specifier being used in any of the format strings.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/functions.sh b/functions.sh
index ad2a551..6523fa8 100644
--- a/functions.sh
+++ b/functions.sh
@@ -519,7 +519,7 @@ fi
 if hash tput 2>/dev/null; then
        genfun_endcol="$(tput cuu1)$(tput cuf $(( genfun_cols - 8 )) )"
 else
-       genfun_endcol='\033[A\033['$(( genfun_cols - 8 ))'C'
+       genfun_endcol="$(printf '\033[A\033[%dC' "$(( genfun_cols - 8 ))")"
 fi
 
 # Setup the colors so our messages all look pretty

Reply via email to