diff --git a/hw/bt-sdp.c b/hw/bt-sdp.c
index b8732d0..c0bfd4d 100644
--- a/hw/bt-sdp.c
+++ b/hw/bt-sdp.c
@@ -171,12 +171,14 @@ static ssize_t sdp_svc_search(struct
bt_l2cap_sdp_state_s *sdp,
     } else
         start = 0;

-    if (len > 1);
+    if (len > 1) {
         return -SDP_INVALID_SYNTAX;
+    }

     /* Output the results */
     len = 4;
     count = 0;
+    max = INT_MAX; /* XXX: probably horribly incorrect */
     end = start;
     for (i = 0; i < sdp->services; i ++)
