break;
}
+ /*
+ * If there's only one byte in the packet, then
+ * it MUST be 0x00. If it's not, then the label
+ * overflows the buffer.
+ */
+ if ((p + 1) >= end) goto overflow;
+
/*
* 0b10 and 0b10 are forbidden
*/
uint8_t *p;
char *q;
+ if (!len) return -1;
+
+ /*
+ * The label must be within the current buffer we're
+ * passed.
+ */
+ if ((label < src) || (label >= end)) return -1;
+
+ /*
+ * The actual packet might start earlier than the buffer,
+ * so reset it if necessary.
+ */
if (lb) packet = lb->start;
/*