Hello community,

here is the log from the commit of package resample for openSUSE:Factory 
checked in at 2012-09-14 12:36:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/resample (Old)
 and      /work/SRC/openSUSE:Factory/.resample.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "resample", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/resample/resample.changes        2011-12-26 
16:29:19.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.resample.new/resample.changes   2012-09-14 
12:36:49.000000000 +0200
@@ -1,0 +2,5 @@
+Tue May 29 14:40:56 CEST 2012 - [email protected]
+
+- Fix the crash with too long file names (bnc#764401)
+
+-------------------------------------------------------------------

New:
----
  resample-filename-length-fix.diff

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

Other differences:
------------------
++++++ resample.spec ++++++
--- /var/tmp/diff_new_pack.Uq42Oa/_old  2012-09-14 12:36:54.000000000 +0200
+++ /var/tmp/diff_new_pack.Uq42Oa/_new  2012-09-14 12:36:54.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package resample
 #
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -15,6 +15,7 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
+
 Name:           resample
 Summary:        Sampling-rate conversion program
 License:        LGPL-2.1+
@@ -23,6 +24,7 @@
 Release:        0
 Url:            http://www-ccrma.stanford.edu/~jos/resample
 Source0:        http://ccrma.stanford.edu/~jos/gz/%{name}-%{version}.tar.bz2
+Patch0:         resample-filename-length-fix.diff
 BuildRequires:  gcc
 BuildRequires:  make
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -38,6 +40,7 @@
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 export CFLAGS="%{optflags} -ggdb"

++++++ resample-filename-length-fix.diff ++++++
---
 src/resample.c |   21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

--- a/src/resample.c
+++ b/src/resample.c
@@ -69,7 +69,7 @@ int main(int argc, char *argv[])
 
     struct stat statbuf;
     char *insfname, *outsfname, *argv0;
-    char filterFile[512] = "";
+    char *filterFile = NULL;
 
     if (argc == 1) {
        fprintf(stderr, USAGE);
@@ -94,8 +94,11 @@ int main(int argc, char *argv[])
            knowFactor = TRUE;
            break;
        case 'f':                              /* -filter filterFile */
-           if (--argc)
-               strcpy(filterFile, *++argv);
+           if (--argc) {
+               filterFile = strdup(*++argv);
+               if (!filterFile)
+                   fail("Cannot allocate filter file name");
+           }
            else
                fail("Need to specify filter file name");
            if (trace)
@@ -197,11 +200,12 @@ int main(int argc, char *argv[])
     if (newsrate <= 0)
       newsrate = (int)((double)insrate * factor + 0.5); /* round */
     
-    sprintf(comment,"%s -by %f %s%s%s%s%s%s%s %s",argv0,factor,
+    snprintf(comment, sizeof(comment),
+            "%s -by %f %s%s%s%s%s%s%s %s",argv0,factor,
            (largeFilter?"-expensiveFilter ":""),
-           (strcmp(filterFile,"")==0?"":"-f "),
-           (strcmp(filterFile,"")==0?"":filterFile),
-           (strcmp(filterFile,"")==0?"":" "),
+           (filterFile && strcmp(filterFile,"")==0?"":"-f "),
+           (filterFile && strcmp(filterFile,"")==0?"":filterFile),
+           (filterFile && strcmp(filterFile,"")==0?"":" "),
            (linearInterp? "-linearSigInterp ":""),
            (interpFilt? "":"-noFilterInterp "),
            insfname, outsfname);
@@ -213,7 +217,8 @@ int main(int argc, char *argv[])
 
     printf("\nStarting Conversion\n");
     outCountReal = resample(factor, infd, outfd, inCount, outCount, nChans,
-                           interpFilt, linearInterp, largeFilter, filterFile);
+                           interpFilt, linearInterp, largeFilter,
+                           filterFile ? filterFile : "");
 
     if (outCountReal <= 0)
       fail("Conversion factor out of range");
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to