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 #11 from Bernd Edlinger <bernd.edlinger@hotmail.de> 2012-08-09 18:01:40 BST ---
(In reply to comment #10)
> Yes, you're correct.
> Using 0 as a "none" sentinal value for a socket/file descriptor is a
> bug. It's not an unusual mistake to make, and for Unix programs it's
> never detected because stdin is (almost) always fd 0, but I tripped
> over the same thing in some other eCos code I wrote years ago.
> Want to submit a patch?

Well, ok. But is no one working on the idea with the blocking socket reads?

If I am to fix that issue I would prefer a completely simple solution.

1. let only one thread enter the select.
2. never close the sockets, because that throws any additionally received
packets away.
3. post the semaphore before the switch(ntohs(hdr->th_opcode))
4. wait for the semaphore again, and go directly to the select.


Bernd.

-- 
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]