bug-inetutils
[Top][All Lists]
Advanced

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

[bug-inetutils] syntax-check: sc_cast_of_alloca_return_value


From: Simon Josefsson
Subject: [bug-inetutils] syntax-check: sc_cast_of_alloca_return_value
Date: Fri, 13 Nov 2009 18:27:39 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)

The patch below fixes:

ftpd/ftpd.c:1945:         nbuf = (char *) alloca (strlen (dirname) + 1 +
rshd/rshd.c:510:            char *remotehost = (char *) alloca (strlen 
(hostname) + 1);
maint.mk: don't cast alloca return value
make: *** [sc_cast_of_alloca_return_value] Error 1

/Simon

>From 315907c800aa606f747ecf82fb04ff36b03a993a Mon Sep 17 00:00:00 2001
From: Simon Josefsson <address@hidden>
Date: Fri, 13 Nov 2009 18:27:15 +0100
Subject: [PATCH] Fix syntax-check sc_cast_of_alloca_return_value.

---
 ChangeLog   |    6 ++++++
 ftpd/ftpd.c |    3 +--
 rshd/rshd.c |    2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 782221e..9a034c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-11-13  Simon Josefsson  <address@hidden>
 
+       * rshd/rshd.c (doit): Fix syntax-check
+       sc_cast_of_alloca_return_value.
+       * ftpd/ftpd.c (send_file_list): Likewise.
+
+2009-11-13  Simon Josefsson  <address@hidden>
+
        * inetd/inetd.c (nextconfig): Fix syntax-check
        sc_cast_of_argument_to_free.
        * hostname/hostname.c (set_name): Likewise.
diff --git a/ftpd/ftpd.c b/ftpd/ftpd.c
index 38e23c4..3a7772d 100644
--- a/ftpd/ftpd.c
+++ b/ftpd/ftpd.c
@@ -1942,8 +1942,7 @@ send_file_list (const char *whichf)
              dir->d_name[2] == '\0')
            continue;
 
-         nbuf = (char *) alloca (strlen (dirname) + 1 +
-                                 strlen (dir->d_name) + 1);
+         nbuf = alloca (strlen (dirname) + 1 + strlen (dir->d_name) + 1);
          sprintf (nbuf, "%s/%s", dirname, dir->d_name);
 
          /* We have to do a stat to insure it's
diff --git a/rshd/rshd.c b/rshd/rshd.c
index 38bc10b..c966e44 100644
--- a/rshd/rshd.c
+++ b/rshd/rshd.c
@@ -507,7 +507,7 @@ doit (int sockfd, struct sockaddr_in *fromp)
 #endif
        if (check_all || local_domain (hp->h_name))
          {
-           char *remotehost = (char *) alloca (strlen (hostname) + 1);
+           char *remotehost = alloca (strlen (hostname) + 1);
            if (!remotehost)
              errorstr = "Out of memory\n";
            else
-- 
1.6.5.2





reply via email to

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