bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-inetutils] GNU inetutils-1.7 tftp not handle long file name bug


From: 王智通
Subject: [bug-inetutils] GNU inetutils-1.7 tftp not handle long file name bug
Date: Tue, 29 Dec 2009 11:32:05 +0800

Hi, all:

 

In GNU inetutils-1.7/tftp/main.c:

 

char line[200];  // cmd line buffer only read 200 bytes, I think it’s too small, if a file name too long(like 256), the tftp client will display:

 

address@hidden tftp]# ls

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.c

 

tftp>put aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.c

No such file or directory

tftp> ?Invalid command

 

the command() function only handle 200 bytes buffer:

static void

command ()

{

  register struct cmd *c;

 

  for (;;)

    {

      printf ("%s> ", prompt);

      if (fgets (line, sizeof line, stdin) == 0)

         {

           if (feof (stdin))

             exit (0);

           else

             continue;

         }

}

 

I think it’s a little bug, maybe the line variable will has a big bufferJ

 

 



This email (including any attachments) is confidential and may be legally privileged. If you received this email in error, please delete it immediately and do not copy it or use it for any purpose or disclose its contents to any other person. Thank you.

本电邮(包括任何附件)可能含有机密资料并受法律保护。如您不是正确的收件人,请您立即删除本邮件。请不要将本电邮进行复制并用作任何其他用途、或透露本邮件之内容。谢谢。

reply via email to

[Prev in Thread] Current Thread [Next in Thread]