Hello community,

here is the log from the commit of package makedumpfile for openSUSE:Factory 
checked in at 2014-02-26 06:58:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/makedumpfile (Old)
 and      /work/SRC/openSUSE:Factory/.makedumpfile.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "makedumpfile"

Changes:
--------
--- /work/SRC/openSUSE:Factory/makedumpfile/makedumpfile.changes        
2014-02-18 14:45:11.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.makedumpfile.new/makedumpfile.changes   
2014-02-26 06:58:46.000000000 +0100
@@ -1,0 +2,8 @@
+Tue Feb 25 11:53:37 UTC 2014 - ptesa...@suse.cz
+
+- makedumpfile-fix-sprintf-append.patch: Fix string append in
+  dump_log_entry() (bnc#865596).
+- makedumpfile-kernel-3.12-supported.patch: Mark kernel 3.12 as
+  supported.
+
+-------------------------------------------------------------------

New:
----
  makedumpfile-fix-sprintf-append.patch
  makedumpfile-kernel-3.12-supported.patch

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

Other differences:
------------------
++++++ makedumpfile.spec ++++++
--- /var/tmp/diff_new_pack.9UiGNr/_old  2014-02-26 06:58:46.000000000 +0100
+++ /var/tmp/diff_new_pack.9UiGNr/_new  2014-02-26 06:58:46.000000000 +0100
@@ -37,6 +37,8 @@
 Source:         %{name}-%{version}.tar.bz2
 Source1:        README.static
 Patch0:         %{name}-coptflags.diff
+Patch1:         %{name}-fix-sprintf-append.patch
+Patch2:         %{name}-kernel-3.12-supported.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 ExclusiveArch:  %ix86 x86_64 ia64 ppc ppc64 ppc64le s390x %arm
 
@@ -55,6 +57,8 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %build
 LIBS_STATIC=

++++++ makedumpfile-fix-sprintf-append.patch ++++++
From: Petr Tesarik <ptesa...@suse.cz>
Subject: Fix string append in dump_log_entry()
References: bnc#865596
Patch-mainline: not yet

To quote the sprintf(3) man page:

    Some programs imprudently rely on code such as the following

        sprintf(buf, "%s some further text", buf);

    to append text to buf.  However, the standards explicitly note that
    the results are undefined if source and destination buffers overlap
    when calling sprintf(), snprintf(), vsprintf(), and vsnprintf().
    Depending on the version of gcc(1) used, and the compiler options
    employed, calls such as the above will not produce the expected results.

It's also overkill to call sprintf() for something that can be done
with a simple assignment.

Signed-off-by: Petr Tesarik <ptesa...@suse.cz>
---
 makedumpfile.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -3830,7 +3830,7 @@ reset_bitmap_of_free_pages(unsigned long
 static int
 dump_log_entry(char *logptr, int fp)
 {
-       char *msg, *p;
+       char *msg, *p, *bufp;
        unsigned int i, text_len;
        unsigned long long ts_nsec;
        char buf[BUFSIZE];
@@ -3845,20 +3845,21 @@ dump_log_entry(char *logptr, int fp)
 
        msg = logptr + SIZE(printk_log);
 
-       sprintf(buf, "[%5lld.%06ld] ", nanos, rem/1000);
+       bufp = buf;
+       bufp += sprintf(buf, "[%5lld.%06ld] ", nanos, rem/1000);
 
        for (i = 0, p = msg; i < text_len; i++, p++) {
                if (*p == '\n')
-                       sprintf(buf, "%s.", buf);
+                       *bufp++ = '.';
                else if (isprint(*p) || isspace(*p))
-                       sprintf(buf, "%s%c", buf, *p);
+                       *bufp++ = *p;
                else
-                       sprintf(buf, "%s.", buf);
+                       *bufp++ = '.';
        }
 
-       sprintf(buf, "%s\n", buf);
+       *bufp++ = '\n';
 
-       if (write(info->fd_dumpfile, buf, strlen(buf)) < 0)
+       if (write(info->fd_dumpfile, buf, bufp - buf) < 0)
                return FALSE;
        else
                return TRUE;
++++++ makedumpfile-kernel-3.12-supported.patch ++++++
From: Petr Tesarik <ptesa...@suse.cz>
Subject: Mark kernel 3.12 as supported
Patch-mainline: not yet

Signed-off-by: Petr Tesarik <ptesa...@suse.cz>
---
 makedumpfile.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/makedumpfile.h
+++ b/makedumpfile.h
@@ -434,7 +434,7 @@ do { \
 #define KVER_MIN_SHIFT 16
 #define KERNEL_VERSION(x,y,z) (((x) << KVER_MAJ_SHIFT) | ((y) << 
KVER_MIN_SHIFT) | (z))
 #define OLDEST_VERSION         KERNEL_VERSION(2, 6, 15)/* linux-2.6.15 */
-#define LATEST_VERSION         KERNEL_VERSION(3, 11, 3)/* linux-3.11.3 */
+#define LATEST_VERSION         KERNEL_VERSION(3, 12, 0xffff)/* linux-3.12.x */
 
 /*
  * vmcoreinfo in /proc/vmcore
-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to