Commit dc2dbb7f authored by Mark Karpilovskij's avatar Mark Karpilovskij

libknot: added error code for unexpected trailing data

parent e8974fa5
......@@ -90,6 +90,7 @@ enum knot_error {
KNOT_ESYSTEM,
KNOT_EFILE,
KNOT_ESOAINVAL,
KNOT_ETRAIL,
/* Control states. */
KNOT_CTL_ESTOP,
......
......@@ -90,6 +90,7 @@ static const struct error errors[] = {
{ KNOT_ESYSTEM, "system error" },
{ KNOT_EFILE, "file error" },
{ KNOT_ESOAINVAL, "SOA mismatch" },
{ KNOT_ETRAIL, "trailing data" },
/* Control states. */
{ KNOT_CTL_ESTOP, "stopping server" },
......
......@@ -771,7 +771,7 @@ int knot_pkt_parse_payload(knot_pkt_t *pkt, unsigned flags)
/* Check for trailing garbage. */
if (pkt->parsed < pkt->size) {
return KNOT_EMALF;
return KNOT_ETRAIL;
}
return KNOT_EOK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment