diff options
-rw-r--r-- | lib/tftp.c | 1 | ||||
-rw-r--r-- | tests/data/Makefile.inc | 2 | ||||
-rw-r--r-- | tests/data/test1453 | 38 |
3 files changed, 40 insertions, 1 deletions
diff --git a/lib/tftp.c b/lib/tftp.c index f6f4bce5b..6477e64ed 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -493,6 +493,7 @@ static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event) if(strlen(filename) > (state->blksize - strlen(mode) - 4)) { failf(data, "TFTP file name too long\n"); + free(filename); return CURLE_TFTP_ILLEGAL; /* too long file name field */ } diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 575cf48cc..9da3e7e94 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -155,7 +155,7 @@ test1424 test1425 test1426 test1427 \ test1428 test1429 test1430 test1431 test1432 test1433 test1434 test1435 \ test1436 test1437 test1438 test1439 test1440 test1441 test1442 test1443 \ test1444 test1445 test1446 test1447 test1448 test1449 test1450 test1451 \ -test1452 \ +test1452 test1453 \ test1500 test1501 test1502 test1503 test1504 test1505 test1506 test1507 \ test1508 test1509 test1510 test1511 test1512 test1513 test1514 test1515 \ test1516 test1517 \ diff --git a/tests/data/test1453 b/tests/data/test1453 new file mode 100644 index 000000000..da0897184 --- /dev/null +++ b/tests/data/test1453 @@ -0,0 +1,38 @@ +<testcase> +<info> +<keywords> +Too long tftp filename +FAILURE +</keywords> +</info> +# +# Server-side +<reply> +</reply> + +# +# Client-side +<client> +<server> +none +</server> +<features> +http +</features> + <name> +Too long tftp filename + </name> + <command> +tftp://%HOSTIP:%TFTPPORT/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz +</command> +</client> + +# +# Verify data after the test has been "shot" +<verify> +# TFTP file name too long +<errorcode> +71 +</errorcode> +</verify> +</testcase> |