mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
r15587@catbus: nickm | 2007-10-09 15:05:27 -0400
When parsing two concatenated networkstatuses (as we do when voting), detect the end of the first one properly. svn:r11810
This commit is contained in:
parent
c9f2afd5fa
commit
a3d4c47515
@ -1531,12 +1531,17 @@ static INLINE const char *
|
|||||||
find_start_of_next_routerstatus(const char *s)
|
find_start_of_next_routerstatus(const char *s)
|
||||||
{
|
{
|
||||||
const char *eos = strstr(s, "\nr ");
|
const char *eos = strstr(s, "\nr ");
|
||||||
if (!eos)
|
if (eos) {
|
||||||
eos = strstr(s, "\ndirectory-signature");
|
const char *eos2 = tor_memstr(s, eos-s, "\ndirectory-signature");
|
||||||
if (eos)
|
if (eos2 && eos2 < eos)
|
||||||
return eos+1;
|
return eos2;
|
||||||
else
|
else
|
||||||
|
return eos+1;
|
||||||
|
} else {
|
||||||
|
if ((eos = strstr(s, "\ndirectory-signature")))
|
||||||
|
return eos+1;
|
||||||
return s + strlen(s);
|
return s + strlen(s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Given a string at *<b>s</b>, containing a routerstatus object, and an
|
/** Given a string at *<b>s</b>, containing a routerstatus object, and an
|
||||||
|
Loading…
Reference in New Issue
Block a user