blob: 2e1a11e48c8c133e288f361372754e6605aaa9c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
$NetBSD: patch-ae,v 1.3.14.1 2006/06/20 11:00:57 ghen Exp $
--- imap/browse.c.orig 2002-02-26 10:38:56.000000000 +0000
+++ imap/browse.c 2006-06-20 10:05:32.000000000 +0100
@@ -452,7 +452,7 @@
if (*s == '\"')
{
s++;
- while (*s && *s != '\"')
+ while (*s && *s != '\"' && n < sizeof (ns) - 1)
{
if (*s == '\\')
s++;
@@ -463,12 +463,14 @@
s++;
}
else
- while (*s && !ISSPACE (*s))
+ while (*s && !ISSPACE (*s) && n < sizeof (ns) - 1)
{
ns[n++] = *s;
s++;
}
ns[n] = '\0';
+ if (n == sizeof (ns) - 1)
+ dprint (1, (debugfile, "browse_get_namespace: too long: [%s]\n", ns));
/* delim? */
s = imap_next_word (s);
/* delimiter is meaningless if namespace is "". Why does
|