This is an automated email from the ASF dual-hosted git repository.

maxyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/main by this push:
     new 526ff094a8 Fix maybe uniniatilzed access of variables
526ff094a8 is described below

commit 526ff094a8e880289b66661a6e1b4c9ee4a523ff
Author: reshke <[email protected]>
AuthorDate: Thu Nov 14 07:14:11 2024 +0000

    Fix maybe uniniatilzed access of variables
    
    Update tag.c
---
 src/backend/commands/tag.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/backend/commands/tag.c b/src/backend/commands/tag.c
index a68382c353..ffe849bd2d 100644
--- a/src/backend/commands/tag.c
+++ b/src/backend/commands/tag.c
@@ -469,9 +469,11 @@ AddTagDescriptions(List *tags,
                char    *tagvalue;
                Datum   datum;
                bool    isnull;
+               bool    has_matching_allowed_val;
                List    *allowed_values;
                ListCell        *value_cell;
                
+               has_matching_allowed_val = false;
                def = lfirst(cell);
                tagname = def->defname;
                tagvalue = defGetString(def);
@@ -499,12 +501,13 @@ AddTagDescriptions(List *tags,
 
                                if (strcmp(tagvalue, allowed_value) == 0)
                                {
+                                       has_matching_allowed_val = true;
                                        break;
                                }
                        }
                }
 
-               if (value_cell || isnull)
+               if (has_matching_allowed_val || isnull)
                {
                        desc_tuple = SearchSysCache4(TAGDESCRIPTION,
                                                                                
 ObjectIdGetDatum(databaseid),


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to