Skip to content

Commit 2355e36

Browse files
committed
complain on invalid input
1 parent 88b5100 commit 2355e36

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/protocols/tacacs/encode.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ static ssize_t tacacs_encode_chap(fr_dbuff_t *dbuff, fr_tacacs_packet_t *packet,
329329
return -1;
330330
}
331331

332+
if (!chap->vp_length) {
333+
fr_strerror_printf("%s is empty", da_chap->name);
334+
return -1;
335+
}
336+
332337
if ((chap->vp_length + challenge->vp_length) > 255) {
333338
fr_strerror_printf("%s and %s are longer than 255 octets", da_chap->name, da_challenge->name);
334339
return -1;

0 commit comments

Comments
 (0)