This is the mail archive of the
mailing list for the eCos project.
[Bug 1001522] Array index out of bounds in tftp_server.c
- From: bugzilla-daemon at bugs dot ecos dot sourceware dot org
- To: ecos-bugs at ecos dot sourceware dot org
- Date: Thu, 9 Aug 2012 18:01:43 +0100
- Subject: [Bug 1001522] Array index out of bounds in tftp_server.c
- Auto-submitted: auto-generated
- References: <email@example.com/>
Please do not reply to this email. Use the web interface provided at:
--- Comment #11 from Bernd Edlinger <firstname.lastname@example.org> 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
3. post the semaphore before the switch(ntohs(hdr->th_opcode))
4. wait for the semaphore again, and go directly to the select.
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.