From 1a6f672b32c7af3b6088cc08d629963b8adc909d Mon Sep 17 00:00:00 2001 From: ianmdlvl Date: Sun, 13 Aug 2006 16:04:19 +0000 Subject: [PATCH] @@ -4,8 +4,9 @@ * backup/snaprsync: allow setting of program to use for summer; allow setting of rsync options; allow settings to be set to empty strings on the command line; do not fail if localprevious,rsums is missing. + * cprogs/summer.c: properly fix for reentrancy of buf. - -- + -- Ian Jackson Sun, 13 Aug 2006 17:04:08 +0100 chiark-utils (4.1.4) unstable; urgency=low --- cprogs/summer.c | 7 +++---- debian/changelog | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cprogs/summer.c b/cprogs/summer.c index 19c8069..ada0f14 100644 --- a/cprogs/summer.c +++ b/cprogs/summer.c @@ -292,7 +292,6 @@ static void recurse(const char *path_or_buf) { static int buf_allocd; struct dirent **namelist, *const *de; - char *subpathp; const char *path_or_0= path_or_buf==buf ? 0 : path_or_buf; int nentries, pathl, esave, buf_want, i; @@ -311,14 +310,14 @@ static void recurse(const char *path_or_buf) { if (path_or_0) strcpy(buf,path_or_0); buf[pathl]= '/'; - subpathp= buf+pathl+1; + pathl++; if (nentries < 0) { - strcpy(subpathp,"\\?"); errno= esave; + strcpy(buf+pathl,"\\?"); errno= esave; problem_e(buf,-1,"scandir failed"); return; } for (i=0, de=namelist; id_name); + strcpy(buf+pathl, (*de)->d_name); node(buf); free(*de); } diff --git a/debian/changelog b/debian/changelog index a1342bb..1e15d90 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,9 @@ chiark-utils (4.1.5) unstable; urgency=low * backup/snaprsync: allow setting of program to use for summer; allow setting of rsync options; allow settings to be set to empty strings on the command line; do not fail if localprevious,rsums is missing. + * cprogs/summer.c: properly fix for reentrancy of buf. - -- + -- Ian Jackson Sun, 13 Aug 2006 17:04:08 +0100 chiark-utils (4.1.4) unstable; urgency=low -- 2.30.2