From 5c8b28cda4bbadf4d77479a5dc290e4bd65b204f Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Wed, 5 Feb 2014 17:38:14 -0800 Subject: [PATCH] Fix crash with an empty buffer --- src/raop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raop.c b/src/raop.c index 7e2fa76b..8b737f99 100644 --- a/src/raop.c +++ b/src/raop.c @@ -3286,12 +3286,12 @@ raop_v2_resend_range(struct raop_session *rs, uint16_t seqnum, uint16_t len) if (pktbuf == pktbuf_head) { - while (seqnum != pktbuf->seqnum) + while (pktbuf && seqnum != pktbuf->seqnum) pktbuf = pktbuf->next; } else { - while (seqnum != pktbuf->seqnum) + while (pktbuf && seqnum != pktbuf->seqnum) pktbuf = pktbuf->prev; }