Patch for utility.c in telnetd.. Here is a patch for a couple of blantantly obvious (to me) possible buffer
overflow problems. From what I could see from the source, putstr() isn't
used for anything bigger than BUFSIZ, so thats my assumption. If anyone
thinks I should, I can change it to accept a maxlength parameter. Try it
out, tell me if ity works or not, and if its any use at all.
Cya.
--
Adrian Chadd | Windows 95 - the XT emulator for
| your 486 and above!
| Being superstitious is bad luck.
diff - utility.c
396a397
> int index = 0;
398c399,403
< while (*s)
---
> while (*s) {
> index++;
> if (index > BUFSIZ) {
> err(1,"putstr(): overflow in string length.\n");
> }
399a405
> }
427c433,435
< char db[100];
---
> char db[BUFSIZ];
> int index;
>
441a450
> index = 0;
444,445c453,463
< putchr(*cp++);
< continue;
---
> if (index > BUFSIZ) {
> err(1, "putf() : overflow in while (*cp)\n");
> } else {
> putchr(*cp++);
> index++;
> continue;
> }
> }
> index++;
> if (index > BUFSIZ) {
> err(1, "putf() : overflow in switch (*+cpp)\n");
Received on Thu Feb 20 02:11:49 1997
This archive was generated by hypermail 2.1.8
: Wed Aug 23 2006 - 12:41:04 EDT
|