Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package atop for openSUSE:Factory checked in 
at 2023-01-08 21:25:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/atop (Old)
 and      /work/SRC/openSUSE:Factory/.atop.new.1563 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "atop"

Sun Jan  8 21:25:30 2023 rev:11 rq:1056803 version:2.8.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/atop/atop.changes        2023-01-02 
15:47:33.660536045 +0100
+++ /work/SRC/openSUSE:Factory/.atop.new.1563/atop.changes      2023-01-08 
21:25:31.375241191 +0100
@@ -1,0 +2,8 @@
+Sat Jan  7 16:56:47 UTC 2023 - Michael Vetter <mvet...@suse.com>
+
+- Update to 2.8.1:
+  * Correct NUMA conversion in logfiles from version 2.7 to 2.8
+  * Avoid buffer overflows during value formatting
+  * Solve compiler warnings about format-truncation
+
+-------------------------------------------------------------------

Old:
----
  atop-2.8.0.tar.gz

New:
----
  atop-2.8.1.tar.gz

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

Other differences:
------------------
++++++ atop.spec ++++++
--- /var/tmp/diff_new_pack.nlklGC/_old  2023-01-08 21:25:31.955244637 +0100
+++ /var/tmp/diff_new_pack.nlklGC/_new  2023-01-08 21:25:31.963244685 +0100
@@ -19,7 +19,7 @@
 
 
 Name:           atop
-Version:        2.8.0
+Version:        2.8.1
 Release:        0
 Summary:        Monitor for System Resources and Process Activity
 License:        GPL-2.0-only

++++++ atop-2.8.0.tar.gz -> atop-2.8.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/atop-2.8.0/AUTHORS new/atop-2.8.1/AUTHORS
--- old/atop-2.8.0/AUTHORS      2022-12-29 23:33:21.000000000 +0100
+++ new/atop-2.8.1/AUTHORS      2023-01-07 14:28:51.000000000 +0100
@@ -2,6 +2,7 @@
 Gerlof Langeveld <gerlof.langev...@atoptool.nl>
 
 Contributions by:
+Jan-Christiaan van Winkel
 Zhenwei Pi
 Fei Li
 Nathan Scott
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/atop-2.8.0/ChangeLog new/atop-2.8.1/ChangeLog
--- old/atop-2.8.0/ChangeLog    2022-12-29 23:33:21.000000000 +0100
+++ new/atop-2.8.1/ChangeLog    2023-01-07 14:28:51.000000000 +0100
@@ -1,3 +1,43 @@
+commit 5bc3edc64ca01dd46922b34402c67c6f286399aa
+Author: Gerlof Langeveld <gerlof.langev...@atoptool.nl>
+Date:   Sat Jan 7 14:27:52 2023 +0100
+
+    Version 2.8.1
+
+M      version.h
+
+commit a2c45992f59ce6110b24b22fc9bf65028197e96d
+Author: Gerlof Langeveld <gerlof.langev...@atoptool.nl>
+Date:   Sat Jan 7 12:21:03 2023 +0100
+
+    Solve compiler warnings about format-truncation
+
+M      various.c
+
+commit b93546d1ed03ec5b6e0c747a2571820129d60771
+Author: Gerlof Langeveld <gerlof.langev...@atoptool.nl>
+Date:   Sat Jan 7 12:02:37 2023 +0100
+
+    Avoid buffer overflows during value formatting
+
+M      various.c
+
+commit 490c73ce516bff6dd53786e2be29bbcbc4185071
+Author: Gerlof Langeveld <gerlof.langev...@atoptool.nl>
+Date:   Sat Jan 7 12:00:36 2023 +0100
+
+    Correct NUMA conversion in logfiles from version 2.7 to 2.8
+
+M      atopconvert.c
+
+commit ed17722fa50f3a0be4d1d4a86336180a38a69109
+Author: Gerlof Langeveld <gerlof.langev...@atoptool.nl>
+Date:   Sat Jan 7 11:16:42 2023 +0100
+
+    Added contributor
+
+M      AUTHORS
+
 commit 338637d911b98d67b3d3b8a25e25532659a36571
 Author: Gerlof Langeveld <gerlof.langev...@atoptool.nl>
 Date:   Thu Dec 29 23:32:50 2022 +0100
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/atop-2.8.0/atopconvert.c new/atop-2.8.1/atopconvert.c
--- old/atop-2.8.0/atopconvert.c        2022-12-29 23:33:20.000000000 +0100
+++ new/atop-2.8.1/atopconvert.c        2023-01-07 14:28:51.000000000 +0100
@@ -294,8 +294,19 @@
 
        for (i=0; i < n28->nrnuma; i++)
        {
-               n28->numa[i].numanr = i;
-               memcpy(&(n28->numa[i].frag), &(n27->numa[i]), sizeof 
n27->numa[i]);
+               n28->numa[i].numanr             = i;
+               n28->numa[i].frag               = n27->numa[i].frag;
+               n28->numa[i].totmem             = n27->numa[i].totmem;
+               n28->numa[i].freemem            = n27->numa[i].freemem;
+               n28->numa[i].filepage           = n27->numa[i].filepage;
+               n28->numa[i].dirtymem           = n27->numa[i].dirtymem;
+               n28->numa[i].filepage           = n27->numa[i].filepage;
+               n28->numa[i].slabmem            = n27->numa[i].slabmem;
+               n28->numa[i].slabreclaim        = n27->numa[i].slabreclaim;
+               n28->numa[i].active             = n27->numa[i].active;
+               n28->numa[i].inactive           = n27->numa[i].inactive;
+               n28->numa[i].shmem              = n27->numa[i].shmem;
+               n28->numa[i].tothp              = n27->numa[i].tothp;
        } 
 }
 
@@ -310,8 +321,17 @@
 
        for (i=0; i < n28->nrnuma; i++)
        {
-               n28->numa[i].numanr = i;
-               memcpy(&(n28->numa[i].nrcpu), &(n27->numa[i]), sizeof 
n27->numa[i]);
+               n28->numa[i].numanr     = i;
+               n28->numa[i].nrcpu      = n27->numa[i].nrcpu;
+               n28->numa[i].stime      = n27->numa[i].stime;
+               n28->numa[i].utime      = n27->numa[i].utime;
+               n28->numa[i].ntime      = n27->numa[i].ntime;
+               n28->numa[i].itime      = n27->numa[i].itime;
+               n28->numa[i].wtime      = n27->numa[i].wtime;
+               n28->numa[i].Itime      = n27->numa[i].Itime;
+               n28->numa[i].Stime      = n27->numa[i].Stime;
+               n28->numa[i].steal      = n27->numa[i].steal;
+               n28->numa[i].guest      = n27->numa[i].guest;
        } 
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/atop-2.8.0/various.c new/atop-2.8.1/various.c
--- old/atop-2.8.0/various.c    2022-12-29 23:33:20.000000000 +0100
+++ new/atop-2.8.1/various.c    2023-01-07 14:28:51.000000000 +0100
@@ -12,7 +12,7 @@
 ** Date:        November 1996
 ** LINUX-port:  June 2000
 ** --------------------------------------------------------------------------
-** Copyright (C) 2000-2010 Gerlof Langeveld
+** Copyright (C) 2000-2022 Gerlof Langeveld
 **
 ** This program is free software; you can redistribute it and/or modify it
 ** under the terms of the GNU General Public License as published by the
@@ -129,7 +129,7 @@
 
        tt = localtime(&utime);
 
-       sprintf(chartim, "%02d:%02d:%02d", tt->tm_hour, tt->tm_min, tt->tm_sec);
+       snprintf(chartim, 9, "%02d:%02d:%02d", tt->tm_hour, tt->tm_min, 
tt->tm_sec);
 
        return chartim;
 }
@@ -146,8 +146,8 @@
 
        tt = localtime(&utime);
 
-       sprintf(chardat, "%04d/%02d/%02d",
-               tt->tm_year+1900, tt->tm_mon+1, tt->tm_mday);
+       snprintf(chardat, 11, "%04u/%02u/%02u",
+               (tt->tm_year+1900)%10000, (tt->tm_mon+1)%100, tt->tm_mday%100);
 
        return chardat;
 }
@@ -273,7 +273,7 @@
 ** Function val2valstr() converts a positive value to an ascii-string of a 
 ** fixed number of positions; if the value does not fit, it will be formatted
 ** to exponent-notation (as short as possible, so not via the standard printf-
-** formatters %f or %e). The offered string should have a length of width+1.
+** formatters %f or %e). The offered buffer should have a length of width+1.
 ** The value might even be printed as an average for the interval-time.
 */
 char *
@@ -282,6 +282,7 @@
        count_t         maxval, remain = 0;
        unsigned short  exp     = 0;
        char            *suffix = "";
+       int             strsize = width+1;
 
        if (avg && nsecs)
        {
@@ -292,7 +293,7 @@
 
        if (value < 0)          // no negative value expected
        {
-               sprintf(strvalue, "%*s%s", width, "?", suffix);
+               snprintf(strvalue, strsize, "%*s%s", width, "?", suffix);
                return strvalue;
        }
 
@@ -300,7 +301,7 @@
 
        if (value < maxval)
        {
-               sprintf(strvalue, "%*lld%s", width, value, suffix);
+               snprintf(strvalue, strsize, "%*lld%s", width, value, suffix);
        }
        else
        {
@@ -309,7 +310,7 @@
                        /*
                        ** cannot avoid ignoring width
                        */
-                       sprintf(strvalue, "%lld%s", value, suffix);
+                       snprintf(strvalue, strsize, "%lld%s", value, suffix);
                }
                else
                {
@@ -330,7 +331,7 @@
                        if (remain >= 5 && value < maxval)
                                value++;
 
-                       sprintf(strvalue, "%*llde%hd%s",
+                       snprintf(strvalue, strsize, "%*llde%hd%s",
                                        width%100, value, exp%100, suffix);
                }
        }
@@ -351,26 +352,35 @@
 int
 val2elapstr(int value, char *strvalue)
 {
-        char   *p=strvalue;
+        char   *p = strvalue;
+       int     rv, n = 14;
 
         if (value >= DAYSECS) 
         {
-                p+=sprintf(p, "%dd", value/DAYSECS);
+                rv = snprintf(p, n, "%dd", value/DAYSECS);
+               p += rv;
+               n -= rv;
         }
 
         if (value >= HOURSECS) 
         {
-                p+=sprintf(p, "%dh", (value%DAYSECS)/HOURSECS);
+                rv = snprintf(p, n, "%dh", (value%DAYSECS)/HOURSECS);
+               p += rv;
+               n -= rv;
         }
 
         if (value >= MINSECS) 
         {
-                p+=sprintf(p, "%dm", (value%HOURSECS)/MINSECS);
+                rv = snprintf(p, n, "%dm", (value%HOURSECS)/MINSECS);
+               p += rv;
+               n -= rv;
         }
 
-        p+=sprintf(p, "%ds", (value%MINSECS));
+        rv = snprintf(p, n, "%ds", (value%MINSECS));
+       p += rv;
+       n -= rv;
 
-        return p-strvalue;
+        return p - strvalue;
 }
 
 
@@ -388,7 +398,8 @@
 {
        if (value < MAXMSEC)
        {
-               sprintf(strvalue, "%2lld.%02llds", value/1000, value%1000/10);
+               snprintf(strvalue, 7, "%2llu.%02llus",
+                               (value/1000)%100, value%1000/10);
        }
        else
        {
@@ -399,7 +410,8 @@
 
                if (value < MAXSEC) 
                {
-                               sprintf(strvalue, "%2lldm%02llds", value/60, 
value%60);
+                               snprintf(strvalue, 7, "%2llum%02llus",
+                                               (value/60)%100, value%60);
                }
                else
                {
@@ -410,8 +422,8 @@
 
                        if (value < MAXMIN) 
                        {
-                               sprintf(strvalue, "%2lldh%02lldm",
-                                                       value/60, value%60);
+                               snprintf(strvalue, 7, "%2lluh%02llum",
+                                               (value/60)%100, value%60);
                        }
                        else
                        {
@@ -420,8 +432,8 @@
                                */
                                value = (value + 30) / 60;
 
-                               sprintf(strvalue, "%2lldd%02lldh",
-                                               value/24, value%24);
+                               snprintf(strvalue, 7, "%2llud%02lluh",
+                                               (value/24)%100, value%24);
                        }
                }
        }
@@ -442,7 +454,7 @@
 
         if (value < 1000)
         {
-                sprintf(strvalue, "%4lldMHz", value);
+                snprintf(strvalue, 8, "%4lluMHz", value%10000);
         }
         else
         {
@@ -467,7 +479,7 @@
                                fformat = "%4.0f%cHz";
                }
 
-                sprintf(strvalue, fformat, fval, prefix);
+                snprintf(strvalue, 8, fformat, fval, prefix);
         }
 
        return strvalue;
@@ -505,7 +517,6 @@
        char    *suffix = "";
        int     basewidth = 6;
 
-
        /*
        ** notice that the value can be negative, in which case the
        ** modulo-value should be evaluated and an extra position should
@@ -527,37 +538,36 @@
                suffix        = "/s";
 
                if (verifyval <= MAXBYTE)       /* bytes ? */
-                       aformat = BFORMAT;
+                   aformat = BFORMAT;
                else
-                       if (verifyval <= MAXKBYTE9)     /* kbytes 1-9 ? */
-                               aformat = KBFORMAT;
-                       else
-                               if (verifyval <= MAXKBYTE)      /* kbytes ? */
-                                       aformat = KBFORMAT_INT;
-                               else
-                                       if (verifyval <= MAXMBYTE9)     /* 
mbytes 1-9 ? */
-                                               aformat = MBFORMAT;
-                                       else
-                                               if (verifyval <= MAXMBYTE)      
/* mbytes 10-999 ? */
-                                                       aformat = MBFORMAT_INT;
-                                               else
-                                                       if (verifyval <= 
MAXGBYTE9)     /* gbytes 1-9 ? */
-                                                               aformat = 
GBFORMAT;
-                                                       else
-                                                               if (verifyval 
<= MAXGBYTE)      /* gbytes 10-999 ? */
-                                                                       aformat 
= GBFORMAT_INT;
-                                                               else
-                                                                       if 
(verifyval <= MAXTBYTE9)/* tbytes 1-9 ? */
-                                                                               
aformat = TBFORMAT;/* tbytes! */
-                                                                       else
-                                                                               
if (verifyval <= MAXTBYTE)/* tbytes 10-999? */
-                                                                               
        aformat = TBFORMAT_INT;/* tbytes! */
-                                                                               
else
-                                                                               
        if (verifyval <= MAXPBYTE9)/* pbytes 1-9 ? */
-                                                                               
                aformat = PBFORMAT;/* pbytes! */
-                                                                               
        else
-                                                                               
                aformat = PBFORMAT_INT;/* pbytes! */
-
+                   if (verifyval <= MAXKBYTE9) /* kbytes 1-9 ? */
+                       aformat = KBFORMAT;
+                   else
+                       if (verifyval <= MAXKBYTE)    /* kbytes ? */
+                           aformat = KBFORMAT_INT;
+                       else
+                           if (verifyval <= MAXMBYTE9)    /* mbytes 1-9 ? */
+                               aformat = MBFORMAT;
+                           else
+                               if (verifyval <= MAXMBYTE)    /* mbytes 10-999 
? */
+                                   aformat = MBFORMAT_INT;
+                               else
+                                   if (verifyval <= MAXGBYTE9)    /* gbytes 
1-9 ? */
+                                       aformat = GBFORMAT;
+                                   else
+                                       if (verifyval <= MAXGBYTE)    /* gbytes 
10-999 ? */
+                                           aformat = GBFORMAT_INT;
+                                       else
+                                           if (verifyval <= MAXTBYTE9)    /* 
tbytes 1-9 ? */
+                                               aformat = TBFORMAT;
+                                           else
+                                               if (verifyval <= MAXTBYTE)    
/* tbytes 10-999? */
+                                                   aformat = TBFORMAT_INT;
+                                               else
+                                                   if (verifyval <= MAXPBYTE9) 
   /* pbytes 1-9 ? */
+                                                       aformat = PBFORMAT;
+                                                   else
+                                                       aformat = PBFORMAT_INT; 
   /* pbytes! */
        } else 
        /*
        ** printed value per interval (normal mode) 
@@ -578,12 +588,10 @@
                                        if (verifyval <= MAXGBYTE)      /* 
gbytes ? */
                                                aformat = GBFORMAT;
                                        else
-                                               if (verifyval <= MAXTBYTE)/* 
tbytes? */
-                                                       aformat = TBFORMAT;/* 
tbytes! */
+                                               if (verifyval <= MAXTBYTE)    
/* tbytes? */
+                                                       aformat = TBFORMAT;
                                                else
-                                                       aformat = PBFORMAT;/* 
pbytes! */
-
-
+                                                       aformat = PBFORMAT;   
/* pbytes! */
        }
 
 
@@ -596,62 +604,80 @@
        switch (aformat)
        {
           case BFORMAT:
-               sprintf(strvalue, "%*lldB%s",
+               snprintf(strvalue, 7, "%*lldB%s",
                                basewidth-1, value, suffix);
                break;
 
           case KBFORMAT:
-               sprintf(strvalue, "%*.1lfK%s",
+               snprintf(strvalue, 7, "%*.1lfK%s",
                        basewidth-1, (double)((double)value/ONEKBYTE), suffix); 
                break;
 
           case KBFORMAT_INT:
-               sprintf(strvalue, "%*lldK%s",
+               snprintf(strvalue, 7, "%*lldK%s",
                                basewidth-1, 
llround((double)((double)value/ONEKBYTE)), suffix);
                break;
 
           case MBFORMAT:
-               sprintf(strvalue, "%*.1lfM%s",
+               snprintf(strvalue, 7, "%*.1lfM%s",
                        basewidth-1, (double)((double)value/ONEMBYTE), suffix); 
                break;
 
           case MBFORMAT_INT:
-               sprintf(strvalue, "%*lldM%s",
+               snprintf(strvalue, 7, "%*lldM%s",
                        basewidth-1, llround((double)((double)value/ONEMBYTE)), 
suffix); 
                break;
 
           case GBFORMAT:
-               sprintf(strvalue, "%*.1lfG%s",
+               snprintf(strvalue, 7, "%*.1lfG%s",
                        basewidth-1, (double)((double)value/ONEGBYTE), suffix);
                break;
 
           case GBFORMAT_INT:
-               sprintf(strvalue, "%*lldG%s",
+               snprintf(strvalue, 7, "%*lldG%s",
                        basewidth-1, llround((double)((double)value/ONEGBYTE)), 
suffix);
                break;
 
           case TBFORMAT:
-               sprintf(strvalue, "%*.1lfT%s",
+               snprintf(strvalue, 7, "%*.1lfT%s",
                        basewidth-1, (double)((double)value/ONETBYTE), suffix);
                break;
 
           case TBFORMAT_INT:
-               sprintf(strvalue, "%*lldT%s",
+               snprintf(strvalue, 7, "%*lldT%s",
                        basewidth-1, llround((double)((double)value/ONETBYTE)), 
suffix);
                break;
 
           case PBFORMAT:
-               sprintf(strvalue, "%*.1lfP%s",
+               snprintf(strvalue, 7, "%*.1lfP%s",
                        basewidth-1, (double)((double)value/ONEPBYTE), suffix);
                break;
 
           case PBFORMAT_INT:
-               sprintf(strvalue, "%*lldP%s",
+               snprintf(strvalue, 7, "%*lldP%s",
                        basewidth-1, llround((double)((double)value/ONEPBYTE)), 
suffix);
                break;
 
           default:
-               sprintf(strvalue, "!TILT!");
+               snprintf(strvalue, 7, "!TILT!");
+       }
+
+       // check if overflow occurred during the formatting
+       // by checking the last byte of the formatted string
+       //
+       switch ( *(strvalue+5) )
+       {
+          case 's':            // in case of per-second value
+          case 'B':
+          case 'K':
+          case 'M':
+          case 'G':
+          case 'T':
+          case 'P':
+               break;
+
+          default:
+               snprintf(strvalue, 7, "OVFLOW");
        }
 
        return strvalue;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/atop-2.8.0/versdate.h new/atop-2.8.1/versdate.h
--- old/atop-2.8.0/versdate.h   2022-12-29 23:33:20.000000000 +0100
+++ new/atop-2.8.1/versdate.h   2023-01-07 14:28:51.000000000 +0100
@@ -1 +1 @@
-#define        ATOPDATE        "2022/12/29 22:30:34"
+#define        ATOPDATE        "2023/01/07 14:27:57"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/atop-2.8.0/version.h new/atop-2.8.1/version.h
--- old/atop-2.8.0/version.h    2022-12-29 23:33:20.000000000 +0100
+++ new/atop-2.8.1/version.h    2023-01-07 14:28:51.000000000 +0100
@@ -1 +1 @@
-#define        ATOPVERS        "2.8.0"
+#define        ATOPVERS        "2.8.1"

Reply via email to