diff options
author | krion <krion@FreeBSD.org> | 2005-09-08 08:21:43 +0000 |
---|---|---|
committer | krion <krion@FreeBSD.org> | 2005-09-08 08:21:43 +0000 |
commit | 4f3d3536bbd4c7652e06e8e5efb56a86c52eb9a5 (patch) | |
tree | 791324609fb02e2532f44965929eaaeb1656a97f /net | |
parent | dfd05cceaf2784ccc2a736714321af57d90e8e51 (diff) | |
download | FreeBSD-ports-4f3d3536bbd4c7652e06e8e5efb56a86c52eb9a5.zip FreeBSD-ports-4f3d3536bbd4c7652e06e8e5efb56a86c52eb9a5.tar.gz |
Fix coredumps on amd64.
PR: ports/85839
Submitted by: maintainer, joerg
Diffstat (limited to 'net')
-rw-r--r-- | net/openradius/files/patch-ringbuf | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/net/openradius/files/patch-ringbuf b/net/openradius/files/patch-ringbuf new file mode 100644 index 0000000..40692df --- /dev/null +++ b/net/openradius/files/patch-ringbuf @@ -0,0 +1,62 @@ +--- common/ringbuf.c.orig Mon Feb 14 16:10:51 2005 ++++ common/ringbuf.c Tue Aug 30 13:55:42 2005 +@@ -355,7 +355,7 @@ + ssize_t ring_count(RING *r, RINGCNTFUNC func, ...) + { + va_list ap; +- ssize_t len, ret; ++ ssize_t len, ret = 0; + + len = ring_maxget(r); + +@@ -363,37 +363,41 @@ + + /* There is data available */ + +- va_start(ap, func); +- + if (r->r + len <= r->size) { + + /* Message ends before end of buffer */ + + /* peek at single part, return whatever the + closure returns. */ +- return func(r->buf + r->r, len, 0, ap); ++ va_start(ap, func); ++ ret = func(r->buf + r->r, len, 0, ap); ++ va_end(ap); + } + else { + + /* Message doesn't end before end of buffer */ + + /* peek at first part, till end of buffer */ ++ va_start(ap, func); + ret = func(r->buf + r->r, r->size - r->r, 0, ap); ++ va_end(ap); + + if (ret < r->size - r->r) { + /* Satisfied by first part; return whatever + the closure gave us. */ +- return ret; + } +- +- /* peek at rest, from start of buffer */ +- return ret + func(r->buf, len - (r->size - r->r), +- ret, ap); ++ else { ++ /* peek at rest, from start of buffer */ ++ va_start(ap, func); ++ ret += func(r->buf, len - (r->size - r->r), ++ ret, ap); ++ va_end(ap); ++ } + } + } + + /* No data available, return 0. */ +- return 0; ++ return ret; + } + + |