CHANGES: 2007-02-07 Daniel J Blueman <daniel.blueman@gmail.com> * Fixed interface statistics gathering and streamlined into a single function. * linux-igd 1.0 released 2006-10-01 Daniel J Blueman <daniel.blueman@gmail.com> * Fixed compilation on GCC-2.9x, noticed by Vyacheslav Garashchenko. * Use bounded string functions, to protect from overflow exploits/stack-smashing.
25 lines
605 B
Text
25 lines
605 B
Text
$NetBSD: patch-ab,v 1.3 2007/03/11 06:26:21 obache Exp $
|
|
|
|
--- config.c.orig 2006-11-13 00:38:46.000000000 +0900
|
|
+++ config.c
|
|
@@ -7,6 +7,20 @@
|
|
|
|
#define NMATCH 3
|
|
|
|
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
|
+static size_t strnlen(const char* s, size_t maxlen) {
|
|
+ int len;
|
|
+
|
|
+ for(len = 0; len < maxlen; len++) {
|
|
+ if(s[len] == '\0') {
|
|
+ len++;
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+ return len;
|
|
+}
|
|
+#endif
|
|
+
|
|
int getConfigOptionArgument(char var[],int varlen, char line[], regmatch_t *submatch)
|
|
{
|
|
/* bound buffer operations to varlen - 1 */
|