Fwd: New Defects reported by Coverity Scan for Konsole

Kurt_009 kurt.hindenburg at gmail.com
Tue Jul 12 16:22:55 BST 2022


FYI, master from just an hour ago
  Regards,
     Kurt

> Begin forwarded message:
> 
> From: scan-admin at coverity.com
> Subject: New Defects reported by Coverity Scan for Konsole
> Date: July 12, 2022 at 11:21:53 AM EDT
> To: kurt.hindenburg at gmail.com
> 
> Hi,
> 
> Please find the latest report on new defect(s) introduced to Konsole found with Coverity Scan.
> 
> 3 new defect(s) introduced to Konsole found with Coverity Scan.
> 
> 
> New defect(s) Reported-by: Coverity Scan
> Showing 3 of 3 defect(s)
> 
> 
> ** CID 354635:  Incorrect expression  (IDENTICAL_BRANCHES)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/Vt102Emulation.cpp: 2150 in Konsole::Vt102Emulation::emulateUpDown(bool, Konsole::KeyboardTranslator::Entry, QByteArray &, int)()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 354635:  Incorrect expression  (IDENTICAL_BRANCHES)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/Vt102Emulation.cpp: 2150 in Konsole::Vt102Emulation::emulateUpDown(bool, Konsole::KeyboardTranslator::Entry, QByteArray &, int)()
> 2144             if ((lineProperties[1] & LINE_WRAPPED) == 0 || (lineProperties[2] & LINE_WRAPPED) == 0) {
> 2145                 realX = qMin(cuX, LineLength(lineProperties[2]) + 1);
> 2146                 num = LineLength(lineProperties[1]) - cuX + realX;
> 2147             }
> 2148         }
> 2149         if (toCol > -1) {
>>>>    CID 354635:  Incorrect expression  (IDENTICAL_BRANCHES)
>>>>    The same code is executed regardless of whether "toCol < realX" is true, because the 'then' and 'else' branches are identical. Should one of the branches be modified, or the entire 'if' statement replaced?
> 2150             if (toCol < realX) {
> 2151                 num += up ? realX - toCol : toCol - realX;
> 2152             } else {
> 2153                 num += up ? realX - toCol : toCol - realX;
> 2154             }
> 2155         }
> 
> ** CID 354634:  Resource leaks  (DELETE_ARRAY)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/Screen.cpp: 1938 in Konsole::Screen::copyLineToStream(int, int, int, Konsole::TerminalCharacterDecoder *, bool, bool, QFlags<Konsole::Screen::DecodingOption>) const()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 354634:  Resource leaks  (DELETE_ARRAY)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/Screen.cpp: 1938 in Konsole::Screen::copyLineToStream(int, int, int, Konsole::TerminalCharacterDecoder *, bool, bool, QFlags<Konsole::Screen::DecodingOption>) const()
> 1932         }
> 1933     
> 1934         // decode line and write to text stream
> 1935         decoder->decodeLine(newBuffer, count, currentLineProperties);
> 1936     
> 1937         if (todel) {
>>>>    CID 354634:  Resource leaks  (DELETE_ARRAY)
>>>>    Deleting array variable "newBuffer" with non-array "delete" in "delete newBuffer".
> 1938             delete newBuffer;
> 1939         }
> 1940     
> 1941         return count;
> 1942     }
> 1943     
> 
> ** CID 354633:    (DEADCODE)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/Vt102Emulation.cpp: 879 in Konsole::Vt102Emulation::receiveChars(const QVector<unsigned int> &)()
> /home/kurthindenburg/Devel/KDE/src/konsole/src/Vt102Emulation.cpp: 872 in Konsole::Vt102Emulation::receiveChars(const QVector<unsigned int> &)()
> /home/kurthindenburg/Devel/KDE/src/konsole/src/Vt102Emulation.cpp: 898 in Konsole::Vt102Emulation::receiveChars(const QVector<unsigned int> &)()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 354633:    (DEADCODE)
> /home/kurthindenburg/Devel/KDE/src/konsole/src/Vt102Emulation.cpp: 879 in Konsole::Vt102Emulation::receiveChars(const QVector<unsigned int> &)()
> 873                         } else if (cc == 0x7F) {
> 874                             // ignore
> 875                         }
> 876                         break;
> 877                     case DcsIgnore:
> 878                         if (cc == 0x9C) {
>>>>    CID 354633:    (DEADCODE)
>>>>    Execution cannot reach this statement: "this->switchState(Konsole::...".
> 879                             switchState(Ground, cc);
> 880                         } else if (cc <= 0x7F) {
> 881                             // ignore
> 882                         }
> 883                         break;
> 884                     case OscString:
> /home/kurthindenburg/Devel/KDE/src/konsole/src/Vt102Emulation.cpp: 872 in Konsole::Vt102Emulation::receiveChars(const QVector<unsigned int> &)()
> 866                         }
> 867                         break;
> 868                     case DcsPassthrough:
> 869                         if (cc <= 0x7E || cc >= 0xA0) { // 0x18, 0x1A, 0x1B already taken care of
> 870                             put(cc);
> 871                         } else if (cc == 0x9C) {
>>>>    CID 354633:    (DEADCODE)
>>>>    Execution cannot reach this statement: "this->switchState(Konsole::...".
> 872                             switchState(Ground, cc);
> 873                         } else if (cc == 0x7F) {
> 874                             // ignore
> 875                         }
> 876                         break;
> 877                     case DcsIgnore:
> /home/kurthindenburg/Devel/KDE/src/konsole/src/Vt102Emulation.cpp: 898 in Konsole::Vt102Emulation::receiveChars(const QVector<unsigned int> &)()
> 892                         }
> 893                         break;
> 894                     case SosPmApcString:
> 895                         if (cc <= 0x7F || cc >= 0xA0) { // 0x18, 0x1A, 0x1B already taken care of.
> 896                             apc_put(cc);
> 897                             // ignore
>>>>    CID 354633:    (DEADCODE)
>>>>    Execution cannot reach this statement: "if (cc == 156U) {
>  this->s...".
> 898                         } else if (cc == 0x9C) {
> 899                             switchState(Ground, cc);
> 900                         }
> 901                         break;
> 902                     default:
> 903                         break;
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20220712/faf0f570/attachment-0001.htm>


More information about the konsole-devel mailing list