2 Subsequent snprintf calls treat the buffer as having size GETREQSIZ, so
3 drop the subtraction. Fix for http://bugs.gentoo.org/337874 by Kevin Pyle
10 /* Get the starting time, prepare GET format string, and start the threads */
11 - fmt = (char *)calloc(GETREQSIZ - 2, sizeof(char));
12 + fmt = (char *)calloc(GETREQSIZ, sizeof(char));
14 for (i = 0; i < nthreads; i++) {
15 soffset = calc_offset(req->clength, i, nthreads);
18 nthreads = h->nthreads;
20 - fmt = (char *)calloc(GETREQSIZ - 2, sizeof(char));
21 + fmt = (char *)calloc(GETREQSIZ, sizeof(char));
23 wthread = (struct thread_data *)malloc(nthreads * sizeof(struct thread_data));
24 memcpy(req, &h->req, sizeof(struct request));
26 Fix useless memset that set 0 bytes to the value of GETRECVSIZ, rather
27 than setting GETRECVSIZ bytes to the value of 0. By Kevin Pyle.
29 --- aget-0.4.1/Download.c
30 +++ aget-0.4.1/Download.c
32 pthread_mutex_unlock(&bwritten_mutex);
34 while (td->offset < foffset) {
35 - memset(rbuf, GETRECVSIZ, 0);
36 + memset(rbuf, 0, GETRECVSIZ);
37 dr = recv(sd, rbuf, GETRECVSIZ, 0);
38 if ((td->offset + dr) > foffset)
39 dw = pwrite(td->fd, rbuf, foffset - td->offset, td->offset);
44 -#define _XOPEN_SOURCE 500
51 fprintf(stderr, "\t\t-h this screen\n");
52 fprintf(stderr, "\t\t-v version info\n");
53 fprintf(stderr, "\n");
54 - fprintf(stderr, "http//www.enderunix.org/aget/\n");
55 + fprintf(stderr, "http://www.enderunix.org/aget/\n");
58 /* reverse a given string */
59 --- aget-0.4.1/Makefile
60 +++ aget-0.4.1/Makefile
62 # http://www.enderunix.org/aget/
64 OBJS = main.o Aget.o Misc.o Head.o Signal.o Download.o Resume.o
73 - $(CC) -o aget $(OBJS) $(LDFLAGS)
76 + $(LINK.o) $^ $(OUTPUT_OPTION)
82 - cp -f aget /usr/local/bin/aget
83 - cp -f aget.1 /usr/share/man/man1/
84 + install -m 0755 -D aget $(DESTDIR)/usr/bin/aget
85 + install -m 0644 -D aget.1 $(DESTDIR)/usr/share/man/man1/aget.1
88 rm -f aget *.o core.* *~