diff -rup ../privoxy-3.0.6-stable.orig/cgi.c ./cgi.c --- ../privoxy-3.0.6-stable.orig/cgi.c 2006-11-21 15:28:41.167678250 +0100 +++ ./cgi.c 2006-11-21 15:29:06.048895730 +0100 @@ -1533,7 +1533,7 @@ jb_err cgi_error_unknown(struct client_s rsp->head_length = 0; rsp->is_static = 0; - sprintf(errnumbuf, "%d", error_to_report); + snprintf(errnumbuf, sizeof(errnumbuf), "%d", error_to_report); rsp->body = malloc(strlen(body_prefix) + strlen(errnumbuf) + strlen(body_suffix) + 1); if (rsp->body == NULL) @@ -1776,7 +1776,7 @@ struct http_response *finish_http_respon /* * Fill in the HTTP Status */ - sprintf(buf, "HTTP/1.0 %s", rsp->status ? rsp->status : "200 OK"); + snprintf(buf, sizeof(buf), "HTTP/1.0 %s", rsp->status ? rsp->status : "200 OK"); err = enlist_first(rsp->headers, buf); /* @@ -1788,7 +1788,7 @@ struct http_response *finish_http_respon } if (!err) { - sprintf(buf, "Content-Length: %d", (int)rsp->content_length); + snprintf(buf, sizeof(buf), "Content-Length: %d", (int)rsp->content_length); err = enlist(rsp->headers, buf); } Only in .: cgi.c~ diff -rup ../privoxy-3.0.6-stable.orig/cgisimple.c ./cgisimple.c --- ../privoxy-3.0.6-stable.orig/cgisimple.c 2006-11-21 15:28:41.168678098 +0100 +++ ./cgisimple.c 2006-11-21 15:29:06.051895274 +0100 @@ -1007,13 +1007,13 @@ jb_err cgi_show_status(struct client_sta perc_rej = (float)local_urls_rejected * 100.0F / (float)local_urls_read; - sprintf(buf, "%d", local_urls_read); + snprintf(buf, sizeof(buf), "%d", local_urls_read); if (!err) err = map(exports, "requests-received", 1, buf, 1); - sprintf(buf, "%d", local_urls_rejected); + snprintf(buf, sizeof(buf), "%d", local_urls_rejected); if (!err) err = map(exports, "requests-blocked", 1, buf, 1); - sprintf(buf, "%6.2f", perc_rej); + snprintf(buf, sizeof(buf), "%6.2f", perc_rej); if (!err) err = map(exports, "percent-blocked", 1, buf, 1); } @@ -1571,7 +1571,7 @@ static char *show_rcs(void) #define SHOW_RCS(__x) \ { \ extern const char __x[]; \ - sprintf(buf, "%s\n", __x); \ + snprintf(buf, sizeof(buf), "%s\n", __x); \ string_append(&result, buf); \ } Only in .: cgisimple.c~ diff -rup ../privoxy-3.0.6-stable.orig/configure.in ./configure.in --- ../privoxy-3.0.6-stable.orig/configure.in 2006-11-21 15:28:41.170677794 +0100 +++ ./configure.in 2006-11-21 15:29:06.054894818 +0100 @@ -1,4 +1,4 @@ -dnl Process this file with autoconf to produce a configure script. +/rdnl Process this file with autoconf to produce a configure script. dnl dnl $Id: configure.in,v 1.96 2006/11/18 14:42:51 fabiankeil Exp $ dnl @@ -760,24 +760,6 @@ fi AC_SUBST(WDUMP) AC_SUBST(DB2HTML) -dnl If we use rpm, we need to check where %_topdir is -AC_CHECK_PROGS(RPMBIN,rpm,false) -if test $RPMBIN != false; then - RPM_BASE=`rpm --eval "%{_topdir}"` - if test "$RPM_BASE" = ""; then - RPM_BASE=/usr/src/redhat - fi -fi -AC_SUBST(RPM_BASE) - -dnl Check for jade, so we can build the documentation -AC_CHECK_PROGS(JADEBIN,jade openjade,false) -AC_SUBST(JADEBIN) - -dnl Check for man2html for docs. -AC_CHECK_PROGS(MAN2HTML,man2html,false) -AC_SUBST(MAN2HTML) - dnl Set doc status flag for conditional content inclusions DOC_STATUS=p-not-stable if test $CODE_STATUS = stable; then Only in .: configure.in~ diff -rup ../privoxy-3.0.6-stable.orig/errlog.c ./errlog.c --- ../privoxy-3.0.6-stable.orig/errlog.c 2006-11-21 15:28:41.197673690 +0100 +++ ./errlog.c 2006-11-21 15:29:06.057894362 +0100 @@ -633,7 +633,7 @@ void log_error(int loglevel, char *fmt, case 'd': ival = va_arg( ap, int ); oldoutc = outc; - outc += sprintf(tempbuf, "%d", ival); + outc += snprintf(tempbuf, sizeof(tempbuf), "%d", ival); if (outc < BUFFER_SIZE-1) { strcpy(outbuf + oldoutc, tempbuf); @@ -646,7 +646,7 @@ void log_error(int loglevel, char *fmt, case 'u': uval = va_arg( ap, unsigned ); oldoutc = outc; - outc += sprintf(tempbuf, "%u", uval); + outc += snprintf(tempbuf, sizeof(tempbuf), "%u", uval); if (outc < BUFFER_SIZE-1) { strcpy(outbuf + oldoutc, tempbuf); @@ -663,13 +663,13 @@ void log_error(int loglevel, char *fmt, { lval = va_arg( ap, long ); oldoutc = outc; - outc += sprintf(tempbuf, "%ld", lval); + outc += snprintf(tempbuf, sizeof(tempbuf), "%ld", lval); } else if (ch == 'u') { ulval = va_arg( ap, unsigned long ); oldoutc = outc; - outc += sprintf(tempbuf, "%lu", ulval); + outc += snprintf(tempbuf, sizeof(tempbuf), "%lu", ulval); } else { @@ -767,7 +767,7 @@ void log_error(int loglevel, char *fmt, #endif /* ndef HAVE_STRERROR */ if (sval == NULL) { - sprintf(tempbuf, "(errno = %d)", ival); + snprintf(tempbuf, sizeof(tempbuf), "(errno = %d)", ival); sval = tempbuf; } #endif /* ndef _WIN32 */ @@ -821,7 +821,7 @@ void log_error(int loglevel, char *fmt, hrs = ((days < -1 ? 24 : 1 < days ? -24 : days * 24) + tm_now->tm_hour - gmt.tm_hour); mins = hrs * 60 + tm_now->tm_min - gmt.tm_min; strftime (tempbuf, BUFFER_SIZE-6, "%d/%b/%Y:%H:%M:%S ", tm_now); - sprintf (tempbuf + strlen(tempbuf), "%+03d%02d", mins / 60, abs(mins) % 60); + snprintf (tempbuf + strlen(tempbuf), sizeof(tempbuf) - strlen(tempbuf), "%+03d%02d", mins / 60, abs(mins) % 60); } oldoutc = outc; outc += strlen(tempbuf); Only in .: errlog.c~ diff -rup ../privoxy-3.0.6-stable.orig/filters.c ./filters.c --- ../privoxy-3.0.6-stable.orig/filters.c 2006-11-21 15:28:41.199673386 +0100 +++ ./filters.c 2006-11-21 15:29:06.061893754 +0100 @@ -1054,7 +1054,7 @@ struct http_response *trust_url(struct c p = strdup(""); for (tl = csp->config->trust_list; (t = *tl) != NULL ; tl++) { - sprintf(buf, "
  • %s
  • \n", t->spec); + snprintf(buf, sizeof(buf), "
  • %s
  • \n", t->spec); string_append(&p, buf); } err = map(exports, "trusted-referrers", 1, p, 0); @@ -1076,7 +1076,7 @@ struct http_response *trust_url(struct c p = strdup(""); for (l = csp->config->trust_info->first; l ; l = l->next) { - sprintf(buf, "
  • %s
    \n",l->str, l->str); + snprintf(buf, sizeof(buf), "
  • %s
    \n",l->str, l->str); string_append(&p, buf); } err = map(exports, "trust-info", 1, p, 0); Only in .: filters.c~ diff -rup ../privoxy-3.0.6-stable.orig/GNUmakefile.in ./GNUmakefile.in --- ../privoxy-3.0.6-stable.orig/GNUmakefile.in 2006-11-21 15:28:41.164678706 +0100 +++ ./GNUmakefile.in 2006-11-21 15:29:06.044896338 +0100 @@ -226,7 +226,7 @@ PTHREAD_LIB = @PTHREAD_ONLY@@PTHREAD_LI SRCS = $(C_SRC) $(W32_SRC) $(PCRS_SRC) $(PCRE_SRC) $(REGEX_SRC) OBJS = $(C_OBJS) $(W32_OBJS) $(PCRS_OBJS) $(PCRE_OBJS) $(REGEX_OBJS) HDRS = $(C_HDRS) $(W32_HDRS) $(PCRS_HDRS) $(PCRE_OBJS) $(REGEX_HDRS) -LIBS = @LIBS@ $(W32_LIB) $(SOCKET_LIB) $(PTHREAD_LIB) +LIBS = @LDFLAGS@ @LIBS@ $(W32_LIB) $(SOCKET_LIB) $(PTHREAD_LIB) ############################################################################# diff -rup ../privoxy-3.0.6-stable.orig/jcc.c ./jcc.c --- ../privoxy-3.0.6-stable.orig/jcc.c 2006-11-21 15:28:41.203672778 +0100 +++ ./jcc.c 2006-11-21 15:29:06.063893450 +0100 @@ -1575,7 +1575,7 @@ static void chat(struct client_state *cs * This is NOT the body, so * Let's pretend the server just sent us a blank line. */ - len = sprintf(buf, "\r\n"); + len = snprintf(buf, sizeof(buf), "\r\n"); /* * Now, let the normal header parsing algorithm below do its @@ -2711,7 +2711,7 @@ static void listen_loop(void) log_error(LOG_LEVEL_ERROR, "can't fork: %E"); - sprintf(buf , "Privoxy: can't fork: errno = %d", errno); + snprintf(buf, sizeof(buf), "Privoxy: can't fork: errno = %d", errno); write_socket(csp->cfd, buf, strlen(buf)); close_socket(csp->cfd); Only in .: jcc.c~ diff -rup ../privoxy-3.0.6-stable.orig/miscutil.c ./miscutil.c --- ../privoxy-3.0.6-stable.orig/miscutil.c 2006-11-21 15:28:41.205672474 +0100 +++ ./miscutil.c 2006-11-21 15:29:06.065893146 +0100 @@ -426,7 +426,7 @@ char *safe_strerror(int err) if (s == NULL) { - sprintf(buf, "(errno = %d)", err); + snprintf(buf, sizeof(buf), "(errno = %d)", err); s = buf; } Only in .: miscutil.c~ Only in .: privoxy.patch diff -rup ../privoxy-3.0.6-stable.orig/urlmatch.c ./urlmatch.c --- ../privoxy-3.0.6-stable.orig/urlmatch.c 2006-11-21 15:28:41.802581730 +0100 +++ ./urlmatch.c 2006-11-21 15:29:06.067892842 +0100 @@ -713,7 +713,7 @@ jb_err create_url_spec(struct url_spec * return JB_ERR_MEMORY; } - sprintf(rebuf, "^(%s)", url->path); + snprintf(rebuf, sizeof(rebuf), "^(%s)", url->path); errcode = regcomp(url->preg, rebuf, (REG_EXTENDED|REG_NOSUB|REG_ICASE)); Only in .: urlmatch.c~