From 09f5afd60ee36cb30076ca7c2ff8ee956d493ca5 Mon Sep 17 00:00:00 2001 From: Jiri Skala Date: Dec 01 2008 12:35:22 +0000 Subject: - Resolves: #473491 unchecked malloc --- diff --git a/ftp.spec b/ftp.spec index 5ec7fb6..0fce59d 100644 --- a/ftp.spec +++ b/ftp.spec @@ -1,7 +1,7 @@ Summary: The standard UNIX FTP (File Transfer Protocol) client Name: ftp Version: 0.17 -Release: 48%{?dist} +Release: 49%{?dist} License: BSD with advertising Group: Applications/Internet Source0: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-ftp-%{version}.tar.gz @@ -30,6 +30,7 @@ Patch21: netkit-ftp-0.17-fprintf.patch Patch22: netkit-ftp-0.17-bitrate.patch Patch23: netkit-ftp-0.17-arg_max.patch Patch24: netkit-ftp-0.17-case.patch +Patch25: netkit-ftp-0.17-chkmalloc.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: glibc-devel, readline-devel, ncurses-devel @@ -68,6 +69,7 @@ file transfers. %patch22 -p1 -b .bitrate %patch23 -p1 -b .arg_max %patch24 -p1 -b .case +%patch25 -p1 -b .chkmalloc %build sh configure --with-c-compiler=gcc --enable-ipv6 @@ -101,6 +103,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_mandir}/man5/netrc.* %changelog +* Mon Dec 01 2008 Jiri Skala - 0.17-49 +- Resolves: #473491 unchecked malloc + * Wed Apr 23 2008 Martin Nagy - 0.17-48 - fix mget when using case - Resolves: #442712 diff --git a/netkit-ftp-0.17-chkmalloc.patch b/netkit-ftp-0.17-chkmalloc.patch new file mode 100644 index 0000000..f9a1210 --- /dev/null +++ b/netkit-ftp-0.17-chkmalloc.patch @@ -0,0 +1,33 @@ +diff -up netkit-ftp-0.17/ftp/ruserpass.c.chkmalloc netkit-ftp-0.17/ftp/ruserpass.c +--- netkit-ftp-0.17/ftp/ruserpass.c.chkmalloc 2008-12-01 11:54:15.000000000 +0100 ++++ netkit-ftp-0.17/ftp/ruserpass.c 2008-12-01 11:56:06.000000000 +0100 +@@ -137,7 +137,8 @@ next: + if (token()) { + if (*aname == 0) { + *aname = malloc((unsigned) strlen(tokval) + 1); +- (void) strcpy(*aname, tokval); ++ if (*aname != NULL) ++ (void) strcpy(*aname, tokval); + } else { + if (strcmp(*aname, tokval)) + goto next; +@@ -158,7 +159,8 @@ next: + } + if (token() && *apass == 0) { + *apass = malloc((unsigned) strlen(tokval) + 1); +- (void) strcpy(*apass, tokval); ++ if (*apass != NULL) ++ (void) strcpy(*apass, tokval); + } + break; + case ACCOUNT: +@@ -170,7 +172,8 @@ next: + } + if (token() && *aacct == 0) { + *aacct = malloc((unsigned) strlen(tokval) + 1); +- (void) strcpy(*aacct, tokval); ++ if (*aacct != NULL) ++ (void) strcpy(*aacct, tokval); + } + break; + case MACDEF: