openbsd-ports/net/slirp/patches/patch-tcp_subr_c
avsm 367c03fc4b almost every sscanf in this package is an off-by-one
couldn't find author to submit patches; dead project?
bump PKGNAME
2003-06-20 13:41:50 +00:00

40 lines
1.8 KiB
Plaintext

$OpenBSD: patch-tcp_subr_c,v 1.1 2003/06/20 13:41:50 avsm Exp $
--- tcp_subr.c.orig Fri Jun 20 14:28:51 2003
+++ tcp_subr.c Fri Jun 20 14:29:32 2003
@@ -900,7 +900,7 @@ tcp_emu(so, m)
*(so_rcv->sb_rptr + num) = 0;
if (ctl_password && !ctl_password_ok) {
/* Need a password */
- if (sscanf(so_rcv->sb_rptr, "pass %256s", buff) == 1) {
+ if (sscanf(so_rcv->sb_rptr, "pass %255s", buff) == 1) {
if (strcmp(buff, ctl_password) == 0) {
ctl_password_ok = 1;
n = sprintf(so_snd->sb_wptr,
@@ -1031,7 +1031,7 @@ do_prompt:
return 1;
/* The %256s is for the broken mIRC */
- if (sscanf(bptr, "DCC CHAT %256s %u %u", buff, &laddr, &lport) == 3) {
+ if (sscanf(bptr, "DCC CHAT %255s %u %u", buff, &laddr, &lport) == 3) {
if ((so = solisten(0, htonl(laddr), htons(lport), SS_FACCEPTONCE)) == NULL)
return 1;
@@ -1039,7 +1039,7 @@ do_prompt:
m->m_len += sprintf(bptr, "DCC CHAT chat %lu %u%c\n",
(unsigned long)ntohl(so->so_faddr.s_addr),
ntohs(so->so_fport), 1);
- } else if (sscanf(bptr, "DCC SEND %256s %u %u %u", buff, &laddr, &lport, &n1) == 4) {
+ } else if (sscanf(bptr, "DCC SEND %255s %u %u %u", buff, &laddr, &lport, &n1) == 4) {
if ((so = solisten(0, htonl(laddr), htons(lport), SS_FACCEPTONCE)) == NULL)
return 1;
@@ -1047,7 +1047,7 @@ do_prompt:
m->m_len += sprintf(bptr, "DCC SEND %s %lu %u %u%c\n",
buff, (unsigned long)ntohl(so->so_faddr.s_addr),
ntohs(so->so_fport), n1, 1);
- } else if (sscanf(bptr, "DCC MOVE %256s %u %u %u", buff, &laddr, &lport, &n1) == 4) {
+ } else if (sscanf(bptr, "DCC MOVE %255s %u %u %u", buff, &laddr, &lport, &n1) == 4) {
if ((so = solisten(0, htonl(laddr), htons(lport), SS_FACCEPTONCE)) == NULL)
return 1;