Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libcomps for openSUSE:Factory 
checked in at 2021-11-06 18:13:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libcomps (Old)
 and      /work/SRC/openSUSE:Factory/.libcomps.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libcomps"

Sat Nov  6 18:13:18 2021 rev:11 rq:929009 version:0.1.18

Changes:
--------
--- /work/SRC/openSUSE:Factory/libcomps/libcomps.changes        2021-08-31 
19:55:01.709898197 +0200
+++ /work/SRC/openSUSE:Factory/.libcomps.new.1890/libcomps.changes      
2021-11-06 18:13:33.900745159 +0100
@@ -1,0 +2,6 @@
+Wed Nov  3 10:42:20 UTC 2021 - Neal Gompa <ngomp...@gmail.com>
+
+- Upgrade to 0.1.18
+  + Fix several covscan warnings
+
+-------------------------------------------------------------------

Old:
----
  libcomps-0.1.17.tar.gz

New:
----
  libcomps-0.1.18.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libcomps.spec ++++++
--- /var/tmp/diff_new_pack.cISAnz/_old  2021-11-06 18:13:34.460745452 +0100
+++ /var/tmp/diff_new_pack.cISAnz/_new  2021-11-06 18:13:34.460745452 +0100
@@ -2,7 +2,7 @@
 # spec file for package libcomps
 #
 # Copyright (c) 2021 SUSE LLC
-# Copyright (c) 2020 Neal Gompa <ngomp...@gmail.com>.
+# Copyright (c) 2021 Neal Gompa <ngomp...@gmail.com>.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 
 %define major 0
 %define minor 1
-%define patch 17
+%define patch 18
 %define libname %{name}%{major}
 %define devname %{name}-devel
 

++++++ libcomps-0.1.17.tar.gz -> libcomps-0.1.18.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libcomps-0.1.17/.github/workflows/release-python.yml 
new/libcomps-0.1.18/.github/workflows/release-python.yml
--- old/libcomps-0.1.17/.github/workflows/release-python.yml    2021-06-14 
15:20:33.000000000 +0200
+++ new/libcomps-0.1.18/.github/workflows/release-python.yml    2021-09-16 
14:13:12.000000000 +0200
@@ -46,7 +46,7 @@
 
     - name: Publish packages to PyPI
       env:
-        TWINE_USERNAME: __TOKEN__
+        TWINE_USERNAME: __token__
         TWINE_PASSWORD: ${{secrets.PYPI_API_TOKEN}}
       run: |
         twine upload dist/*.tar.gz
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libcomps-0.1.17/libcomps/src/comps_doc.c 
new/libcomps-0.1.18/libcomps/src/comps_doc.c
--- old/libcomps-0.1.17/libcomps/src/comps_doc.c        2021-06-14 
15:20:33.000000000 +0200
+++ new/libcomps-0.1.18/libcomps/src/comps_doc.c        2021-09-16 
14:13:12.000000000 +0200
@@ -644,7 +644,6 @@
     COMPS_ObjMDict *mdict;
     COMPS_HSList *hslist;
     COMPS_HSListItem *hsit;
-    char *tmp;
     int retc;
     signed char ret = 0, tmpret;
 
@@ -709,7 +708,7 @@
             xmlTextWriterWriteAttribute(writer, BAD_CAST "name",
                     (xmlChar*) ((COMPS_ObjRTreePair*)hsit->data)->key);
 
-            tmp = comps_object_tostr(((COMPS_ObjRTreePair*)hsit->data)->data);
+            char *tmp = 
comps_object_tostr(((COMPS_ObjRTreePair*)hsit->data)->data);
             xmlTextWriterWriteAttribute(writer, BAD_CAST "install", BAD_CAST 
tmp);
             free(tmp);
 
@@ -749,7 +748,7 @@
                 xmlTextWriterWriteAttribute(writer, BAD_CAST "name",
                         (xmlChar*) ((COMPS_ObjRTreePair*)hsit->data)->key);
 
-                tmp = comps_object_tostr(it->comps_obj);
+                char *tmp = comps_object_tostr(it->comps_obj);
                 xmlTextWriterWriteAttribute(writer, BAD_CAST "arch", BAD_CAST 
tmp);
                 free(tmp);
 
@@ -789,7 +788,7 @@
                 xmlTextWriterWriteAttribute(writer, BAD_CAST "requires",
                         (xmlChar*) ((COMPS_ObjRTreePair*)hsit->data)->key);
 
-                tmp = comps_object_tostr(it->comps_obj);
+                char *tmp = comps_object_tostr(it->comps_obj);
                 xmlTextWriterWriteAttribute(writer, BAD_CAST "package", 
BAD_CAST tmp);
                 free(tmp);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libcomps-0.1.17/libcomps/src/comps_doccategory.c 
new/libcomps-0.1.18/libcomps/src/comps_doccategory.c
--- old/libcomps-0.1.17/libcomps/src/comps_doccategory.c        2021-06-14 
15:20:33.000000000 +0200
+++ new/libcomps-0.1.18/libcomps/src/comps_doccategory.c        2021-09-16 
14:13:12.000000000 +0200
@@ -317,8 +317,13 @@
     total_len += strlen(desc_by_lang_str);
     group_ids_str = comps_object_tostr((COMPS_Object*)_cat_->group_ids);
     total_len += strlen(group_ids_str);
-    
-    ret = malloc(sizeof(char) * (total_len+2+(6*2)+strlen(head)));
+
+    if ((ret = malloc(sizeof(char) * (total_len+2+(6*2)+strlen(head)))) == 
NULL) {
+        free(name_by_lang_str);
+        free(desc_by_lang_str);
+        free(group_ids_str);
+        return NULL;
+    }
     ret[0] = 0;
     strcat(ret, head);
     for (int i=0; i<4; i++) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libcomps-0.1.17/libcomps/src/comps_docenv.c 
new/libcomps-0.1.18/libcomps/src/comps_docenv.c
--- old/libcomps-0.1.17/libcomps/src/comps_docenv.c     2021-06-14 
15:20:33.000000000 +0200
+++ new/libcomps-0.1.18/libcomps/src/comps_docenv.c     2021-09-16 
14:13:12.000000000 +0200
@@ -415,8 +415,14 @@
     total_len += strlen(group_list_str);
     option_list_str = comps_object_tostr((COMPS_Object*)_env_->option_list);
     total_len += strlen(option_list_str);
-    
-    ret = malloc(sizeof(char) * (total_len+2+(8*2)+strlen(head)));
+
+    if ((ret = malloc(sizeof(char) * (total_len+2+(8*2)+strlen(head)))) == 
NULL) {
+        free(name_by_lang_str);
+        free(desc_by_lang_str);
+        free(group_list_str);
+        free(option_list_str);
+        return NULL;
+    }
     ret[0] = 0;
     strcat(ret, head);
     for (int i=0; i<4; i++) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libcomps-0.1.17/libcomps/src/comps_docgroup.c 
new/libcomps-0.1.18/libcomps/src/comps_docgroup.c
--- old/libcomps-0.1.17/libcomps/src/comps_docgroup.c   2021-06-14 
15:20:33.000000000 +0200
+++ new/libcomps-0.1.18/libcomps/src/comps_docgroup.c   2021-09-16 
14:13:12.000000000 +0200
@@ -399,8 +399,13 @@
     total_len += strlen(desc_by_lang_str);
     group_packages_str = comps_object_tostr((COMPS_Object*)_group_->packages);
     total_len += strlen(group_packages_str);
-    
-    ret = malloc(sizeof(char) * (total_len+2+(8*2)+strlen(head)));
+
+    if ((ret = malloc(sizeof(char) * (total_len+2+(8*2)+strlen(head)))) == 
NULL) {
+        free(name_by_lang_str);
+        free(desc_by_lang_str);
+        free(group_packages_str);
+        return NULL;
+    }
     ret[0] = 0;
     strcat(ret, head);
     for (int i=0; i<6; i++) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libcomps-0.1.17/libcomps/src/comps_parse.c 
new/libcomps-0.1.18/libcomps/src/comps_parse.c
--- old/libcomps-0.1.17/libcomps/src/comps_parse.c      2021-06-14 
15:20:33.000000000 +0200
+++ new/libcomps-0.1.18/libcomps/src/comps_parse.c      2021-09-16 
14:13:12.000000000 +0200
@@ -436,19 +436,16 @@
 }
 
 void comps_parse_check_attributes(COMPS_Parsed *parsed, COMPS_Elem* elem) {
-    #define parser_line XML_GetCurrentLineNumber(parsed->parser)
-    #define parser_col XML_GetCurrentColumnNumber(parsed->parser)
     const COMPS_ElemInfo *info;
     info = COMPS_ElemInfos[elem->type];
     int attr_count;
     COMPS_HSList *keys;
     char *val;
-    COMPS_HSListItem *it;
 
     for (attr_count = 0; info->attributes[attr_count] != NULL; attr_count++);
     keys = comps_dict_keys(elem->attrs);
     for (int x =0; x<attr_count; x++) {
-        for (it = keys->first; it != NULL; it = it->next) {
+        for (COMPS_HSListItem *it = keys->first; it != NULL; it = it->next) {
             if (strcmp((char*)it->data, info->attributes[x]->name) == 0) {
                 if (info->attributes[x]->val_check) {
                     val = comps_dict_get(elem->attrs, it->data);
@@ -464,12 +461,11 @@
             }
         }
     }
-    for (it = keys->first; it != NULL; it = it->next) {
+    for (COMPS_HSListItem *it = keys->first; it != NULL; it = it->next) {
         comps_log_warning_x(parsed->log, COMPS_ERR_ATTR_UNKNOWN, 4,
                             comps_str(it->data), comps_str(info->name),
-                            comps_num(parser_line), comps_num(parser_col));
+                            
comps_num(XML_GetCurrentLineNumber(parsed->parser)),
+                            
comps_num(XML_GetCurrentColumnNumber(parsed->parser)));
     }
     comps_hslist_destroy(&keys);
-    #undef parser_line
-    #undef parser_col
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libcomps-0.1.17/libcomps/src/comps_set.c 
new/libcomps-0.1.18/libcomps/src/comps_set.c
--- old/libcomps-0.1.17/libcomps/src/comps_set.c        2021-06-14 
15:20:33.000000000 +0200
+++ new/libcomps-0.1.18/libcomps/src/comps_set.c        2021-09-16 
14:13:12.000000000 +0200
@@ -113,14 +113,16 @@
 }
 
 void* comps_set_remove(COMPS_Set *set, void *item) {
-    void * ret;
-    COMPS_HSListItem * it;
-    for (it = set->data->first; it != NULL; it = it->next) {
-        if (set->eqf(it->data, item)) {
-            comps_hslist_remove(set->data, it);
-            ret = it->data;
-            free(it);
-            return ret;
+    if (set && set->data) {
+        void * ret;
+        COMPS_HSListItem * it;
+        for (it = set->data->first; it != NULL; it = it->next) {
+            if (set->eqf(it->data, item)) {
+                comps_hslist_remove(set->data, it);
+                ret = it->data;
+                free(it);
+                return ret;
+            }
         }
     }
     return NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libcomps-0.1.17/libcomps/src/python/src/pycomps.c 
new/libcomps-0.1.18/libcomps/src/python/src/pycomps.c
--- old/libcomps-0.1.17/libcomps/src/python/src/pycomps.c       2021-06-14 
15:20:33.000000000 +0200
+++ new/libcomps-0.1.18/libcomps/src/python/src/pycomps.c       2021-09-16 
14:13:12.000000000 +0200
@@ -499,7 +499,6 @@
     PyCOMPS *doc;
     COMPS_Doc *comps_doc;
     PyObject *item;
-    char *str;
     char created = 0;
     if ((Py_TYPE(other) != &PyCOMPS_StrSeqType) &&
         (Py_TYPE(other) != &PyList_Type)) {
@@ -512,9 +511,12 @@
         arches = COMPS_OBJECT_CREATE(COMPS_ObjList, NULL);
         for (Py_ssize_t x=0; x < PyList_Size(other); x++) {
             item = PyList_GetItem(other, x);
-            __pycomps_arg_to_char(item, &str);
-            comps_objlist_append_x(arches, (COMPS_Object*)comps_str(str));
-            free(str);
+            char *str;
+            if (__pycomps_arg_to_char(item, &str)) {
+                COMPS_OBJECT_DESTROY(arches);
+                return NULL;
+            }
+            comps_objlist_append_x(arches, (COMPS_Object*)comps_str_x(str));
         }
     } else {
         arches = ((PyCOMPS_Sequence*)other)->list;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libcomps-0.1.17/libcomps/src/python/src/pycomps_sequence.c 
new/libcomps-0.1.18/libcomps/src/python/src/pycomps_sequence.c
--- old/libcomps-0.1.17/libcomps/src/python/src/pycomps_sequence.c      
2021-06-14 15:20:33.000000000 +0200
+++ new/libcomps-0.1.18/libcomps/src/python/src/pycomps_sequence.c      
2021-09-16 14:13:12.000000000 +0200
@@ -307,12 +307,14 @@
         n = _seq_->list->len;
         uret = PySlice_GetIndicesEx((PyObject*)key, n,
                                    &istart, &istop, &istep, &ilen);
+        if (uret) return -1;
         if (ilen == 0) {
             uret = PySlice_GetIndicesEx((PyObject*)key, n+istart,
                                        &istart, &istop, &istep, &ilen);
         }
         if (uret) return -1;
         if (val) {
+            // set val for list items indexed by given slice
             if (Py_TYPE(self) != Py_TYPE(val)) {
                 PyErr_SetString(PyExc_TypeError, "different object class");
                 return -1;
@@ -340,12 +342,17 @@
             for (i=0 ; i<istart && it != NULL; it=it->next, i++);
             if (istep != 1) {
                 while (clen != ilen) {
+                    if (!it) {
+                        PyErr_SetString(PyExc_ValueError,
+                                        "failed to index list using the given 
slice");
+                        return -1;
+                    }
                     COMPS_OBJECT_DESTROY(it->comps_obj);
                     it->comps_obj = comps_object_incref(it2->comps_obj);
                     clen += 1;
                     it2 = it2->next;
                     for (i=0 ; i<istep && it != NULL; it=it->next,  i++);
-                    if (!it) it = ((PyCOMPS_Sequence*)self)->list->first;
+                    if (!it) it = _seq_->list->first;
                     for (; i<istep; it=it->next, i++);
                 }
             } else {
@@ -359,46 +366,51 @@
                 }
                 if (it == NULL) {
                     for (;it2 != NULL; it2 = it2->next) {
-                        comps_objlist_append(((PyCOMPS_Sequence*)self)->list,
-                                          it2->comps_obj);
+                        comps_objlist_append(_seq_->list, it2->comps_obj);
                     }
                 }
                 if (it != NULL) {
                     for (c = i; c < istop; c++) {
-                        
comps_objlist_remove_at(((PyCOMPS_Sequence*)self)->list,
-                                              i);
+                        comps_objlist_remove_at(_seq_->list, i);
                     }
                 }
             }
             return 0;
         } else {
+            // if val is NULL we want to delete list items indexed by given 
slice
             clen = 0;
-            it = ((PyCOMPS_Sequence*)self)->list->first;
+            it = _seq_->list->first;
             for (i=0 ; i<istart && it != NULL; it=it->next, i++);
             while (clen != ilen) {
+                if (!it) {
+                    PyErr_SetString(PyExc_ValueError,
+                                    "failed to index list using the given 
slice");
+                    return -1;
+                }
                 if (it->comps_obj) {
                     COMPS_OBJECT_DESTROY(it->comps_obj);
                     it->comps_obj = NULL;
                 }
                 clen+=1;
                 for (i=0 ; i<istep && it != NULL; it=it->next,  i++);
-                if (!it) it = ((PyCOMPS_Sequence*)self)->list->first;
+                if (!it) it = _seq_->list->first;
                 for (; i<istep; it=it->next, i++);
             }
             it2 = NULL;
-            for (i=0, it = ((PyCOMPS_Sequence*)self)->list->first;
+            for (i=0, it = _seq_->list->first;
                  it != NULL; it2 = it, it = it->next, i++) {
                 if (it2 && !it2->comps_obj) {
-                    comps_objlist_remove_at(((PyCOMPS_Sequence*)self)->list, 
i);
+                    comps_objlist_remove_at(_seq_->list, i);
                 }
             }
             if (it2 && !it2->comps_obj) {
-                comps_objlist_remove_at(((PyCOMPS_Sequence*)self)->list, i);
+                comps_objlist_remove_at(_seq_->list, i);
             }
             return 0;
         }
     }
     return 0;
+    #undef _seq_
 }
 
 int __PyCOMPSSeq_set(PyObject *self, PyObject *key, PyObject *val,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libcomps-0.1.17/libcomps/src/python/tests/__test.py 
new/libcomps-0.1.18/libcomps/src/python/tests/__test.py
--- old/libcomps-0.1.17/libcomps/src/python/tests/__test.py     2021-06-14 
15:20:33.000000000 +0200
+++ new/libcomps-0.1.18/libcomps/src/python/tests/__test.py     2021-09-16 
14:13:12.000000000 +0200
@@ -1088,6 +1088,11 @@
         comps5.fromxml_str(s)
         self.assertTrue(comps == comps5)
 
+    def test_arches_invalid_input(self):
+        INVALID_UTF8_CHAR = '\udcfd'
+        c = libcomps.Comps()
+        self.assertRaises(TypeError, c.arch_filter, [INVALID_UTF8_CHAR])
+
     #@unittest.skip("")
     def test_validate(self):
         c = libcomps.Comps()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libcomps-0.1.17/libcomps/version.cmake 
new/libcomps-0.1.18/libcomps/version.cmake
--- old/libcomps-0.1.17/libcomps/version.cmake  2021-06-14 15:20:33.000000000 
+0200
+++ new/libcomps-0.1.18/libcomps/version.cmake  2021-09-16 14:13:12.000000000 
+0200
@@ -1,5 +1,5 @@
 set (libcomps_VERSION_MAJOR 0)
 set (libcomps_VERSION_MINOR 1)
-set (libcomps_VERSION_PATCH 17)
+set (libcomps_VERSION_PATCH 18)
 set (libcomps_RELEASE 1)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libcomps-0.1.17/libcomps.spec 
new/libcomps-0.1.18/libcomps.spec
--- old/libcomps-0.1.17/libcomps.spec   2021-06-14 15:20:33.000000000 +0200
+++ new/libcomps-0.1.18/libcomps.spec   2021-09-16 14:13:12.000000000 +0200
@@ -1,13 +1,13 @@
 %define __cmake_in_source_build 1
 
 Name:           libcomps
-Version:        0.1.17
+Version:        0.1.18
 Release:        1%{?dist}
 Summary:        Comps XML file manipulation library
 
 License:        GPLv2+
 URL:            https://github.com/rpm-software-management/libcomps
-Source0:        %{url}/archive/%{name}-%{version}/%{name}-%{version}.tar.gz
+Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz
 
 BuildRequires:  gcc-c++
 BuildRequires:  cmake
@@ -58,7 +58,7 @@
 Python3 bindings for libcomps library.
 
 %prep
-%autosetup -n %{name}-%{name}-%{version}
+%autosetup -n %{name}-%{version}
 
 mkdir build-py3
 mkdir build-doc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libcomps-0.1.17/version.cmake 
new/libcomps-0.1.18/version.cmake
--- old/libcomps-0.1.17/version.cmake   2021-06-14 15:20:33.000000000 +0200
+++ new/libcomps-0.1.18/version.cmake   2021-09-16 14:13:12.000000000 +0200
@@ -1,5 +1,5 @@
 set (libcomps_VERSION_MAJOR 0)
 set (libcomps_VERSION_MINOR 1)
-set (libcomps_VERSION_PATCH 17)
+set (libcomps_VERSION_PATCH 18)
 set (libcomps_RELEASE 1)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libcomps-0.1.17/version.json 
new/libcomps-0.1.18/version.json
--- old/libcomps-0.1.17/version.json    2021-06-14 15:20:33.000000000 +0200
+++ new/libcomps-0.1.18/version.json    2021-09-16 14:13:12.000000000 +0200
@@ -2,5 +2,5 @@
     "libcomps_VERSION_MAJOR": 0,
     "libcomps_RELEASE": 1,
     "libcomps_VERSION_MINOR": 1,
-    "libcomps_VERSION_PATCH": 17
+    "libcomps_VERSION_PATCH": 18
 }

Reply via email to