diff options
author | emax <emax@FreeBSD.org> | 2007-11-16 15:13:12 +0000 |
---|---|---|
committer | emax <emax@FreeBSD.org> | 2007-11-16 15:13:12 +0000 |
commit | fa5e7c42160a8e6ff1792ae29f017228e8a24df2 (patch) | |
tree | d633a06901e49ab684b62277c1a64c1d59541d2b /lib/libsdp | |
parent | 1cef71b2800c3648ac06c1413d612898c8023eba (diff) | |
download | FreeBSD-src-fa5e7c42160a8e6ff1792ae29f017228e8a24df2.zip FreeBSD-src-fa5e7c42160a8e6ff1792ae29f017228e8a24df2.tar.gz |
Fix bug in handling SDP continuation state.
Reported by: Eric Millbrandt emillbrandt at coldhaus dot com
MFC after: 3 days
Diffstat (limited to 'lib/libsdp')
-rw-r--r-- | lib/libsdp/search.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libsdp/search.c b/lib/libsdp/search.c index 54ac3a4..868fbe5 100644 --- a/lib/libsdp/search.c +++ b/lib/libsdp/search.c @@ -204,15 +204,18 @@ sdp_search(void *xss, return (-1); } + rsp += xpdu.len; + ss->tid ++; + /* Save continuation state (if any) */ - ss->cslen = rsp[xpdu.len]; + ss->cslen = rsp[0]; if (ss->cslen > 0) { if (ss->cslen > sizeof(ss->cs)) { ss->error = ENOBUFS; return (-1); } - memcpy(ss->cs, rsp + xpdu.len + 1, ss->cslen); + memcpy(ss->cs, rsp + 1, ss->cslen); /* * Ensure that we always have ss->imtu bytes @@ -236,9 +239,6 @@ sdp_search(void *xss, rsp = ss->rsp + offset; } } - - rsp += xpdu.len; - ss->tid ++; } while (ss->cslen > 0); /* |