Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f9941d
)
Tweaked the checking of the "limit" in safe_fname().
author
Wayne Davison
<wayned@samba.org>
Tue, 3 May 2005 16:44:47 +0000
(16:44 +0000)
committer
Wayne Davison
<wayned@samba.org>
Tue, 3 May 2005 16:44:47 +0000
(16:44 +0000)
util.c
patch
|
blob
|
blame
|
history
diff --git
a/util.c
b/util.c
index
cde7571
..
6cbe7e1
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-892,7
+892,7
@@
char *safe_fname(const char *fname)
char *t;
ndx = (ndx + 1) % MAX_SAFE_NAMES;
- for (t = fbuf[ndx]; *fname
&& limit
; fname++) {
+ for (t = fbuf[ndx]; *fname; fname++) {
if (*fname == '\\') {
if ((limit -= 2) < 0)
break;
@@
-904,7
+904,8
@@
char *safe_fname(const char *fname)
sprintf(t, "\\%03o", *(uchar*)fname);
t += 4;
} else {
- limit--;
+ if (--limit < 0)
+ break;
*t++ = *fname;
}
}