This is the mail archive of the ecos-bugs@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug 1001522] Array index out of bounds in tftp_server.c


Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001522

--- Comment #13 from Bernd Edlinger <bernd.edlinger@hotmail.de> 2012-08-10 10:57:17 BST ---
(In reply to comment #12)
> I'm afraid I'm not.  I don't use tftp and don't even have any
> filesystem which it could access.  I only stumbled across the original
> bug because I was getting sick of wasting so much time sorting through
> all the compiler warnings trying figure out which ones mattered and
> which ones didn't.

I do completely agree with you.

> I think the existing code is rather badly and fundamentally broken.
> If I were going to re-write it I'd probably throw out the whole
> multi-thread prallel operation business and do a single-threaded, one
> transfer at a time version that's as simple to understand and as
> obviously correct as possible.
> I don't know what the use case is for multiple parallel transfers.  If
> I _were_ to use tftp it would be for firmware updates which I'd force
> to be a single transfer at a time anyway.

True.

Maybe this multi-threaded feature should be off by default in the cdl file.

It is nearly impossible to fix it, because if every thread opens
its own socket, the tcp stack does not know which one will be ready
to handle the packet.

Therefore I think, it is better to just fix the warning,
by _not_ sending an error packet in the multi threaded operation.

Nevertheless, i spent some effort to fix the error handling.

However I found more subtle glitches in the error handling logic,
than I had expected!

I tested with the tftp_server_test, with and without multi-thread.
Of course I did just send valid tftp packets with the windows tftp
client, so the default case in the switch was never executed.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]