49 lines
1.4 KiB
Diff
49 lines
1.4 KiB
Diff
--- iptables-1.2.11/ip6tables.c.autoload 2004-11-11 12:03:35.221306429 +0100
|
|
+++ iptables-1.2.11/ip6tables.c 2004-11-11 12:04:43.382900379 +0100
|
|
@@ -1595,15 +1595,18 @@
|
|
int procfile;
|
|
char *ret;
|
|
|
|
+#define PROCFILE_BUFSIZ 1024
|
|
+
|
|
procfile = open(PROC_SYS_MODPROBE, O_RDONLY);
|
|
if (procfile < 0)
|
|
return NULL;
|
|
|
|
- ret = malloc(1024);
|
|
+ ret = malloc(PROCFILE_BUFSIZ);
|
|
if (ret) {
|
|
- switch (read(procfile, ret, 1024)) {
|
|
+ memset(ret, 0, PROCFILE_BUFSIZ);
|
|
+ switch (read(procfile, ret, PROCFILE_BUFSIZ)) {
|
|
case -1: goto fail;
|
|
- case 1024: goto fail; /* Partial read. Wierd */
|
|
+ case PROCFILE_BUFSIZ: goto fail; /* Partial read. Wierd */
|
|
}
|
|
if (ret[strlen(ret)-1]=='\n')
|
|
ret[strlen(ret)-1]=0;
|
|
--- iptables-1.2.11/iptables.c.autoload 2004-11-11 12:01:35.601815606 +0100
|
|
+++ iptables-1.2.11/iptables.c 2004-11-11 12:02:50.496478760 +0100
|
|
@@ -1593,15 +1593,18 @@
|
|
int procfile;
|
|
char *ret;
|
|
|
|
+#define PROCFILE_BUFSIZ 1024
|
|
+
|
|
procfile = open(PROC_SYS_MODPROBE, O_RDONLY);
|
|
if (procfile < 0)
|
|
return NULL;
|
|
|
|
- ret = malloc(1024);
|
|
+ ret = malloc(PROCFILE_BUFSIZ);
|
|
if (ret) {
|
|
- switch (read(procfile, ret, 1024)) {
|
|
+ memset(ret, 0, PROCFILE_BUFSIZ);
|
|
+ switch (read(procfile, ret, PROCFILE_BUFSIZ)) {
|
|
case -1: goto fail;
|
|
- case 1024: goto fail; /* Partial read. Wierd */
|
|
+ case PROCFILE_BUFSIZ: goto fail; /* Partial read. Wierd */
|
|
}
|
|
if (ret[strlen(ret)-1]=='\n')
|
|
ret[strlen(ret)-1]=0;
|