public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] redboot's gets() buffer overflow
@ 2001-04-12  8:34 Robin Farine
  2001-04-12 10:26 ` Jonathan Larmour
  0 siblings, 1 reply; 2+ messages in thread
From: Robin Farine @ 2001-04-12  8:34 UTC (permalink / raw)
  To: ecos-discuss

Hi,

The gets() routine in redboot/current/src/io.c does not make use of its buflen
argument. I propose that the routine returns buflen when it reaches the end of
the buffer (this matches the routine's comment but could break some client code
that only check for _GETS_OK):

2001-04-12  Robin Farine  <acnrf@dial.eunet.ch>

	* src/io.c (gets): Checks for buffer overflow and returns buflen
	if it reaches the end of the buffer.

-------------------------<snip>-----------------------------------------
Index: io.c
===================================================================
RCS file: /usr/cvs/eCos/base/packages/redboot/current/src/io.c,v
retrieving revision 1.1.1.2
retrieving revision 1.3
diff -r1.1.1.2 -r1.3
259a260,261
> 	if (ptr == buf + buflen)
> 	  return buflen;
-------------------------<snip>-----------------------------------------

Robin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] redboot's gets() buffer overflow
  2001-04-12  8:34 [ECOS] redboot's gets() buffer overflow Robin Farine
@ 2001-04-12 10:26 ` Jonathan Larmour
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Larmour @ 2001-04-12 10:26 UTC (permalink / raw)
  To: Robin Farine; +Cc: ecos-discuss

Robin Farine wrote:
> 
> Hi,
> 
> The gets() routine in redboot/current/src/io.c does not make use of its buflen
> argument.

Thanks - I've checked this in along with a change for main.c to make sure
it deals with it correctly.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-04-12 10:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-12  8:34 [ECOS] redboot's gets() buffer overflow Robin Farine
2001-04-12 10:26 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).