Skip to content
Snippets Groups Projects
Commit 0fa01654 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

fix from lark: make memarea_strndup() work even at the end of a mmap chunk. ...

fix from lark: make memarea_strndup() work even at the end of a mmap chunk.  Bug was harmless for now, I think.

svn:r19094
parent 4962e466
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,10 @@ Changes in version 0.2.1.14-??? - 2009-03-?? ...@@ -12,6 +12,10 @@ Changes in version 0.2.1.14-??? - 2009-03-??
0.2.0.33. 0.2.0.33.
- Avoid double-free on list of successfully uploaded hidden - Avoid double-free on list of successfully uploaded hidden
service discriptors. Fix for bug 948. Bugfix on 0.2.1.6-alpha. service discriptors. Fix for bug 948. Bugfix on 0.2.1.6-alpha.
- Change memarea_strndup() implementation to work even when
duplicating a string at the end of a page. This bug was
harmless for now, but could have meant crashes later. Fix by
lark. Bugfix on 0.2.1.1-alpha.
o Minor features (controller): o Minor features (controller):
- Try harder to look up nicknames for routers on a circuit when - Try harder to look up nicknames for routers on a circuit when
......
...@@ -237,7 +237,7 @@ memarea_strndup(memarea_t *area, const char *s, size_t n) ...@@ -237,7 +237,7 @@ memarea_strndup(memarea_t *area, const char *s, size_t n)
size_t ln; size_t ln;
char *result; char *result;
const char *cp, *end = s+n; const char *cp, *end = s+n;
for (cp = s; *cp && cp < end; ++cp) for (cp = s; cp < end && *cp; ++cp)
; ;
/* cp now points to s+n, or to the 0 in the string. */ /* cp now points to s+n, or to the 0 in the string. */
ln = cp-s; ln = cp-s;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment