[konsole] [Bug 394565] New: In Vt102Emulation snprintf truncation warnings while compiling

Ahmad Samir bugzilla_noreply at kde.org
Tue May 22 13:06:05 UTC 2018


https://bugs.kde.org/show_bug.cgi?id=394565

            Bug ID: 394565
           Summary: In Vt102Emulation snprintf truncation warnings while
                    compiling
           Product: konsole
           Version: master
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: konsole-devel at kde.org
          Reporter: a.samirh78 at gmail.com
  Target Milestone: ---

Possibly related to this change[1]; I got this compiling current git master:
/home/builder/rpmbuild/konsole5/konsole5-f27/BUILD/konsole-18.07.70/src/Vt102Emulation.cpp:
In member function 'void Konsole::Vt102Emulation::reportCursorPosition()':
/home/builder/rpmbuild/konsole5/konsole5-f27/BUILD/konsole-18.07.70/src/Vt102Emulation.cpp:955:30:
warning: '%d' directive output may be truncated writing between 1 and 11 bytes
into a region of size between 6 and 16 [-Wformat-truncation=]
   snprintf(tmp, sizeof(tmp), "\033[%d;%dR", _currentScreen->getCursorY()+1,
_currentScreen->getCursorX()+1);
                              ^~~~~~~~~~~~~
/home/builder/rpmbuild/konsole5/konsole5-f27/BUILD/konsole-18.07.70/src/Vt102Emulation.cpp:955:30:
note: directive argument in the range [-2147483647, 2147483647]
In file included from /usr/include/stdio.h:862,
                 from /usr/include/c++/8/cstdio:42,
                 from /usr/include/c++/8/ext/string_conversions.h:43,
                 from /usr/include/c++/8/bits/basic_string.h:6361,
                 from /usr/include/c++/8/string:52,
                 from /usr/include/qt5/QtCore/qbytearray.h:52,
                 from /usr/include/qt5/QtCore/qstring.h:49,
                 from /usr/include/qt5/QtCore/qhashfunctions.h:44,
                 from /usr/include/qt5/QtCore/qlist.h:47,
                 from /usr/include/qt5/QtCore/qhash.h:46,
                 from /usr/include/qt5/QtCore/QHash:1,
                 from
/home/builder/rpmbuild/konsole5/konsole5-f27/BUILD/konsole-18.07.70/src/Vt102Emulation.h:27,
                 from
/home/builder/rpmbuild/konsole5/konsole5-f27/BUILD/konsole-18.07.70/src/Vt102Emulation.cpp:24:
/usr/include/bits/stdio2.h:64:35: note: '__builtin___snprintf_chk' output
between 7 and 27 bytes into a destination of size 20
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/builder/rpmbuild/konsole5/konsole5-f27/BUILD/konsole-18.07.70/src/Vt102Emulation.cpp:
In member function 'virtual void Konsole::Vt102Emulation::sendMouseEvent(int,
int, int, int)':
/home/builder/rpmbuild/konsole5/konsole5-f27/BUILD/konsole-18.07.70/src/Vt102Emulation.cpp:1057:44:
warning: '%d' directive output may be truncated writing between 1 and 10 bytes
into a region of size between 7 and 26 [-Wformat-truncation=]
         snprintf(command, sizeof(command), "\033[%d;%d;%dM", cb + 0x20, cx,
cy);
                                            ^~~~~~~~~~~~~~~~
/home/builder/rpmbuild/konsole5/konsole5-f27/BUILD/konsole-18.07.70/src/Vt102Emulation.cpp:1057:44:
note: directive argument in the range [1, 2147483647]
In file included from /usr/include/stdio.h:862,
                 from /usr/include/c++/8/cstdio:42,
                 from /usr/include/c++/8/ext/string_conversions.h:43,
                 from /usr/include/c++/8/bits/basic_string.h:6361,
                 from /usr/include/c++/8/string:52,
                 from /usr/include/qt5/QtCore/qbytearray.h:52,
                 from /usr/include/qt5/QtCore/qstring.h:49,
                 from /usr/include/qt5/QtCore/qhashfunctions.h:44,
                 from /usr/include/qt5/QtCore/qlist.h:47,
                 from /usr/include/qt5/QtCore/qhash.h:46,
                 from /usr/include/qt5/QtCore/QHash:1,
                 from
/home/builder/rpmbuild/konsole5/konsole5-f27/BUILD/konsole-18.07.70/src/Vt102Emulation.h:27,
                 from
/home/builder/rpmbuild/konsole5/konsole5-f27/BUILD/konsole-18.07.70/src/Vt102Emulation.cpp:24:
/usr/include/bits/stdio2.h:64:35: note: '__builtin___snprintf_chk' output
between 9 and 37 bytes into a destination of size 32
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[1]

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the konsole-devel mailing list