- Resolves: #473491 unchecked malloc

This commit is contained in:
Jiri Skala 2008-12-01 12:35:22 +00:00
parent d3ca284819
commit 09f5afd60e
2 changed files with 39 additions and 1 deletions

View File

@ -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 <jskala@redhat.com> - 0.17-49
- Resolves: #473491 unchecked malloc
* Wed Apr 23 2008 Martin Nagy <mnagy@redhat.com> - 0.17-48
- fix mget when using case
- Resolves: #442712

View File

@ -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: