openbsd-ports/net/ircd-hybrid/patches/patch-src_irc_string_c
jasper 546caf8233 Security fix for CVE-2009-4016, "IRCD-hybrid 'LINKS' Command
Integer Underflow Vulnerability.

tested and ok ajacoutot@
2010-02-01 09:23:33 +00:00

56 lines
1.3 KiB
Plaintext

$OpenBSD: patch-src_irc_string_c,v 1.1 2010/02/01 09:23:33 jasper Exp $
Security fix for CVE-2009-4016, "IRCD-hybrid 'LINKS' Command
Integer Underflow Vulnerability.
Patch from upstream svn, revision 1044.
--- src/irc_string.c.orig Mon Feb 1 09:20:21 2010
+++ src/irc_string.c Mon Feb 1 09:20:39 2010
@@ -70,46 +70,6 @@ myctime(time_t value)
}
/*
- * clean_string - clean up a string possibly containing garbage
- *
- * *sigh* Before the kiddies find this new and exciting way of
- * annoying opers, lets clean up what is sent to local opers
- * -Dianora
- */
-char *
-clean_string(char* dest, const unsigned char* src, size_t len)
-{
- char* d = dest;
- assert(0 != dest);
- assert(0 != src);
-
- if(dest == NULL || src == NULL)
- return NULL;
-
- len -= 3; /* allow for worst case, '^A\0' */
-
- while (*src && (len > 0))
- {
- if (*src & 0x80) /* if high bit is set */
- {
- *d++ = '.';
- --len;
- }
- else if (!IsPrint(*src)) /* if NOT printable */
- {
- *d++ = '^';
- --len;
- *d++ = 0x40 + *src; /* turn it into a printable */
- }
- else
- *d++ = *src;
- ++src, --len;
- }
- *d = '\0';
- return dest;
-}
-
-/*
* strip_tabs(dst, src, length)
*
* Copies src to dst, while converting all \t (tabs) into spaces.