commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-341-gaa759


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-341-gaa759e0
Date: Tue, 10 Sep 2013 10:39:15 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  aa759e0f86f275bd673a9b6361cba20dff6b2210 (commit)
      from  9bbef0cb92f92b12586d0368ff05b15f73ba74c9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=aa759e0f86f275bd673a9b6361cba20dff6b2210


commit aa759e0f86f275bd673a9b6361cba20dff6b2210
Author: Mats Erik Andersson <address@hidden>
Date:   Tue Sep 10 12:22:44 2013 +0200

    ftp: Rare memory leak.

diff --git a/ChangeLog b/ChangeLog
index 3cf43a2..bcaef78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2013-09-10  Mats Erik Andersson  <address@hidden>
+
+       ftp: Rare memory leak.
+
+       * ftp/ruserpass.c (remote_userpass) <missing domain>:
+       Assign empty string to MYDOMAIN, do not allocate.
+       The standard use is to set MYDOMAIN pointing into
+       MYNAME without allocation.  Do assignment of TMP
+       before if-clause.
+
 2013-09-08  Mats Erik Andersson  <address@hidden>
 
        ftp: Guard buffer size.
diff --git a/ftp/ruserpass.c b/ftp/ruserpass.c
index 8e1775c..4df004f 100644
--- a/ftp/ruserpass.c
+++ b/ftp/ruserpass.c
@@ -114,7 +114,7 @@ int
 remote_userpass (char *host, char **aname, char **apass, char **aacct)
 {
   char *hdir, buf[BUFSIZ], *tmp;
-  char *myname = 0, *mydomain;
+  char *myname, *mydomain;
   int t, c, usedefault = 0;
   size_t i;
   struct stat stb;
@@ -137,7 +137,8 @@ remote_userpass (char *host, char **aname, char **apass, 
char **aacct)
 
   mydomain = strchr (myname, '.');
   if (mydomain == NULL)
-    mydomain = xstrdup ("");
+    mydomain = "";
+
  next:
   while ((t = token ()))
     switch (t)
@@ -159,12 +160,14 @@ remote_userpass (char *host, char **aname, char **apass, 
char **aacct)
              goto match;
            if (strcasecmp (hostname, tokval) == 0)
              goto match;
-           if ((tmp = strchr (hostname, '.')) != NULL
+           tmp = strchr (hostname, '.');
+           if (tmp != NULL
                && strcasecmp (tmp, mydomain) == 0
                && strncasecmp (hostname, tokval, tmp - hostname) == 0
                && tokval[tmp - hostname] == '\0')
              goto match;
-           if ((tmp = strchr (host, '.')) != NULL
+           tmp = strchr (host, '.');
+           if (tmp != NULL
                && strcasecmp (tmp, mydomain) == 0
                && strncasecmp (host, tokval, tmp - host) == 0
                && tokval[tmp - host] == '\0')

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog       |   10 ++++++++++
 ftp/ruserpass.c |   11 +++++++----
 2 files changed, 17 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]