1 diff --git a/lib/ftdecode.c b/lib/ftdecode.c
2 index ff6b0cf..8884db9 100644
5 @@ -122,8 +122,10 @@ int ftpdu_verify(struct ftpdu *ftpdu)
8 /* enough bytes to decode the count and version? */
9 - if (ftpdu->bused < 4)
10 + if (ftpdu->bused < 4) {
11 + fterr_warnx("not enough bytes to decode the count and version.");
12 goto ftpdu_verify_out_quick;
15 ph = (struct ftpdu_header*)&ftpdu->buf;
17 @@ -158,15 +160,22 @@ #endif /* LITTLE_ENDIAN */
20 /* max PDU's in record */
21 - if (ph->count > FT_PDU_V5_MAXFLOWS)
22 + if (ph->count > FT_PDU_V5_MAXFLOWS) {
23 + fterr_warnx("too many pdus (%d) in record, max %d", ph->count,
24 + FT_PDU_V5_MAXFLOWS);
25 goto ftpdu_verify_out;
29 size = offsetof(struct ftpdu_v5, records) +
30 ph->count * sizeof (struct ftrec_v5);
32 /* PDU received size == PDU expected size? */
33 - if (size != ftpdu->bused)
34 + if (size != ftpdu->bused) {
35 + fterr_warnx("pdu received size was wrong. expected %d got %d",
36 + ftpdu->bused, size);
37 goto ftpdu_verify_out;
40 ftpdu->ftv.d_version = 5;
41 ftpdu->decodef = fts3rec_pdu_v5_decode;
42 @@ -516,6 +525,7 @@ #endif /* LITTLE_ENDIAN */
46 + fterr_warnx("ftpdu version not set.");
47 goto ftpdu_verify_out;
49 } /* switch ph->version */