[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Strip extra trailing newlines when parsing router descripto...
Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv22620/src/or
Modified Files:
routerparse.c
Log Message:
Strip extra trailing newlines when parsing router descriptors.
Index: routerparse.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerparse.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -d -r1.151 -r1.152
--- routerparse.c 30 Sep 2005 21:22:25 -0000 1.151
+++ routerparse.c 7 Oct 2005 18:33:30 -0000 1.152
@@ -694,6 +694,10 @@
end = s + strlen(s);
}
+ /* point 'end' to a point immediately after the final newline. */
+ while (end > s+2 && *(end-1) == '\n' && *(end-2) == '\n')
+ --end;
+
if (router_get_router_hash(s, digest) < 0) {
log_fn(LOG_WARN, "Couldn't compute router hash.");
return NULL;