rpms/dos2unix/devel dos2unix-c-missing-arg.patch, NONE, 1.1 dos2unix.spec, 1.28, 1.29

Tim Waugh (twaugh) fedora-extras-commits at redhat.com
Fri Jan 18 09:27:50 UTC 2008


Author: twaugh

Update of /cvs/pkgs/rpms/dos2unix/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17979

Modified Files:
	dos2unix.spec 
Added Files:
	dos2unix-c-missing-arg.patch 
Log Message:
* Fri Jan 18 2008 Tim Waugh <twaugh at redhat.com> 3.1-30
- Applied patch from bug #292100 to fix segfault with missing -c argument.


dos2unix-c-missing-arg.patch:

--- NEW FILE dos2unix-c-missing-arg.patch ---
diff -up dos2unix-3.1/dos2unix.c.c-missing-arg dos2unix-3.1/dos2unix.c
--- dos2unix-3.1/dos2unix.c.c-missing-arg	2008-01-18 09:24:21.000000000 +0000
+++ dos2unix-3.1/dos2unix.c	2008-01-18 09:25:43.000000000 +0000
@@ -533,19 +533,28 @@ int main (int argc, char *argv[])
       
       if ((strcmp(argv[ArgIdx],"-c") == 0) || (strcmp(argv[ArgIdx],"--convmode") == 0))
       {
-        ArgIdx++;
-        if (strcmpi(argv[ArgIdx],"ASCII") == 0)
-          pFlag->ConvMode = 0;
-        else if (strcmpi(argv[ArgIdx], "7Bit") == 0)
-          pFlag->ConvMode = 1;
-        else if (strcmpi(argv[ArgIdx], "ISO") == 0)
-          pFlag->ConvMode = 2;
-        else if (strcmpi(argv[ArgIdx], "Mac") == 0)
-          pFlag->ConvMode = 3;
+        if (++ArgIdx < argc)
+        {
+          if (strcmpi(argv[ArgIdx],"ASCII") == 0)
+            pFlag->ConvMode = 0;
+          else if (strcmpi(argv[ArgIdx], "7Bit") == 0)
+            pFlag->ConvMode = 1;
+          else if (strcmpi(argv[ArgIdx], "ISO") == 0)
+            pFlag->ConvMode = 2;
+          else if (strcmpi(argv[ArgIdx], "Mac") == 0)
+            pFlag->ConvMode = 3;
+          else
+          {
+            if (!pFlag->Quiet)
+              fprintf(stderr, "dos2unix: invalid %s conversion mode specified\n",argv[ArgIdx]);
+            ShouldExit = 1;
+          }
+        }
         else
         {
+          ArgIdx--;
           if (!pFlag->Quiet)
-            fprintf(stderr, "dos2unix: invalid %s conversion mode specified\n",argv[ArgIdx]);
+            fprintf(stderr,"dos2unix: option `%s' requires an argument\n",argv[ArgIdx]);
           ShouldExit = 1;
         }
       }


Index: dos2unix.spec
===================================================================
RCS file: /cvs/pkgs/rpms/dos2unix/devel/dos2unix.spec,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- dos2unix.spec	29 Aug 2007 14:26:20 -0000	1.28
+++ dos2unix.spec	18 Jan 2008 09:27:14 -0000	1.29
@@ -1,7 +1,7 @@
 Summary: Text file format converter
 Name: dos2unix
 Version: 3.1
-Release: 29%{?dist}
+Release: 30%{?dist}
 Group: Applications/Text
 License: Freely distributable
 Source: %{name}-%{version}.tar.bz2
@@ -11,6 +11,7 @@
 Patch3: dos2unix-3.1-manpage-update-57507.patch
 Patch4: dos2unix-3.1-preserve-file-modes.patch
 Patch5: dos2unix-3.1-tmppath.patch
+Patch6: dos2unix-c-missing-arg.patch
 
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -25,6 +26,7 @@
 %patch3 -p1 -b .manpage-update-57507
 %patch4 -p1 -b .preserve-file-modes
 %patch5 -p1 -b .tmppath
+%patch6 -p1 -b .c-missing-arg
 
 for I in *.[ch]; do
 	sed -e 's,#endif.*,#endif,g' -e 's,#else.*,#else,g' $I > $I.new
@@ -57,6 +59,9 @@
 rm -rf $RPM_BUILD_ROOT
 
 %changelog
+* Fri Jan 18 2008 Tim Waugh <twaugh at redhat.com> 3.1-30
+- Applied patch from bug #292100 to fix segfault with missing -c argument.
+
 * Wed Aug 29 2007 Tim Waugh <twaugh at redhat.com> 3.1-29
 - Rebuild.
 




More information about the fedora-extras-commits mailing list