[PATCH] coverity#704628/704629/704630 Explicit null dereferenced

Julien Nabet (via Code Review) gerrit at gerrit.libreoffice.org
Wed Mar 20 05:28:00 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2869

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/69/2869/1

coverity#704628/704629/704630 Explicit null dereferenced

+ return early if no whichid or after default case

Change-Id: I40f3ec310604ccde22022dd2e82984b0f3057307
---
M editeng/source/rtf/rtfitem.cxx
1 file changed, 9 insertions(+), 9 deletions(-)



diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index 462e688..fcc70ee 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -141,17 +141,17 @@
 
     case 0:
         // it exist no WhichId - don't set this item
-        break;
+        return;
 
     default:
        rSet.Put( rItem );
-       break;
+       return;
     }
 
 
     if( DOUBLEBYTE_CHARTYPE == eType )
     {
-        if( bIsLeftToRightDef && *pCJK )
+        if( bIsLeftToRightDef && pCJK )
         {
             rItem.SetWhich( *pCJK );
             rSet.Put( rItem );
@@ -159,7 +159,7 @@
     }
     else if( !bIsLeftToRightDef )
     {
-        if( *pCTL )
+        if( pCTL )
         {
             rItem.SetWhich( *pCTL );
             rSet.Put( rItem );
@@ -169,7 +169,7 @@
     {
         if( LOW_CHARTYPE == eType )
         {
-            if( *pNormal )
+            if( pNormal )
             {
                 rItem.SetWhich( *pNormal );
                 rSet.Put( rItem );
@@ -177,7 +177,7 @@
         }
         else if( HIGH_CHARTYPE == eType )
         {
-            if( *pCTL )
+            if( pCTL )
             {
                 rItem.SetWhich( *pCTL );
                 rSet.Put( rItem );
@@ -185,17 +185,17 @@
         }
         else
         {
-            if( *pCJK )
+            if( pCJK )
             {
                 rItem.SetWhich( *pCJK );
                 rSet.Put( rItem );
             }
-            if( *pCTL )
+            if( pCTL )
             {
                 rItem.SetWhich( *pCTL );
                 rSet.Put( rItem );
             }
-            if( *pNormal )
+            if( pNormal )
             {
                 rItem.SetWhich( *pNormal );
                 rSet.Put( rItem );

-- 
To view, visit https://gerrit.libreoffice.org/2869
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I40f3ec310604ccde22022dd2e82984b0f3057307
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Julien Nabet <serval2412 at yahoo.fr>



More information about the LibreOffice mailing list