pkgsrc-Bugs archive

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

pkg/43491: libfetch compile warnings with gcc in ftp.c



>Number:         43491
>Category:       pkg
>Synopsis:       libfetch compile warnings with gcc in ftp.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 20 16:25:00 +0000 2010
>Originator:     Dan McGee
>Release:        N/A
>Organization:
Arch Linux
>Environment:
Linux galway 2.6.34-ARCH #1 SMP PREEMPT Sat Jun 19 00:07:49 CEST 2010 x86_64 
Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz GenuineIntel GNU/Linux
>Description:
Compiling libfetch under gcc (GCC) 4.5.0 20100610 (prerelease) on Linux yields 
the following warnings, which are easily fixable. This was with 2.32 but it has 
existed for a while.

$ make
  compile    ftp.o
ftp.c: In function ?ftp_transfer?:
ftp.c:917:45: warning: array subscript is above array bounds
ftp.c:917:33: warning: array subscript is above array bounds
ftp.c:917:21: warning: array subscript is above array bounds
ftp.c:917:9: warning: array subscript is above array bounds
ftp.c:916:43: warning: array subscript is above array bounds
ftp.c:916:31: warning: array subscript is above array bounds
ftp.c:916:20: warning: array subscript is above array bounds
ftp.c:916:9: warning: array subscript is above array bounds


>How-To-Repeat:
Compile libfetch 2.32 from source; not sure if you need a newer version of GCC 
to see these warnings.
>Fix:


Index: libfetch/files/ftp.c
===================================================================
RCS file: /cvsroot/pkgsrc/net/libfetch/files/ftp.c,v
retrieving revision 1.35
diff -u -r1.35 ftp.c
--- libfetch/files/ftp.c        21 Mar 2010 16:48:43 -0000      1.35
+++ libfetch/files/ftp.c        20 Jun 2010 16:18:00 -0000
@@ -907,7 +907,7 @@
                                        goto ouch;
                        }
                        if (e != FTP_OK) {
-                               ap = (char *)&u.sin6.sin6_addr;
+                               ap = (char *)&u.sin6.sin6_addr.s6_addr;
                                e = ftp_cmd(conn,
                                    "LPRT 
%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\r\n",
                                    6, 16,




Home | Main Index | Thread Index | Old Index