There were software bugs in 3 source files, most due to wrong use of sizeof (e.g. using the size of a pointer instead of the data, or subtracting a value from the argument of sizeof, not the resulting size value. A test for a short write assigned the length written to a variable and performed a comparison with that variable in a single expression and with no defined order of the these two operations resulting in either a comparison with 0 (the value before assignement) or with the just assigned value (tautological comparison). Either case did not catch a short write. I have not checked the quality of the code nay further than these issues that caused compiler warnings, but given the severity and fundamental lack of understanding shown by these examples, I'm not convinced that this program can be trusted to work correctly.
42 lines
1 KiB
C
42 lines
1 KiB
C
--- loadconfig.h.orig 2007-05-14 15:19:00 UTC
|
|
+++ loadconfig.h
|
|
@@ -12,23 +12,23 @@ enum {
|
|
VALSIZE = 256
|
|
};
|
|
|
|
-int wcnt;
|
|
-int bcnt;
|
|
-int pcnt;
|
|
-int enable_subj_filt;
|
|
+extern int wcnt;
|
|
+extern int bcnt;
|
|
+extern int pcnt;
|
|
+extern int enable_subj_filt;
|
|
|
|
-char logtype[VALSIZE];
|
|
-char logfile[VALSIZE];
|
|
-char ignorefile[VALSIZE];
|
|
-char highfile[VALSIZE];
|
|
-char badmailfile[VALSIZE];
|
|
-char hostname[VALSIZE];
|
|
-char sysadmin[VALSIZE];
|
|
-char statfile[VALSIZE];
|
|
-char mail_command[VALSIZE];
|
|
-char makemap_command[VALSIZE];
|
|
-char qsheff_rules_file[VALSIZE];
|
|
-char trim_subj_str[VALSIZE];
|
|
+extern char logtype[VALSIZE];
|
|
+extern char logfile[VALSIZE];
|
|
+extern char ignorefile[VALSIZE];
|
|
+extern char highfile[VALSIZE];
|
|
+extern char badmailfile[VALSIZE];
|
|
+extern char hostname[VALSIZE];
|
|
+extern char sysadmin[VALSIZE];
|
|
+extern char statfile[VALSIZE];
|
|
+extern char mail_command[VALSIZE];
|
|
+extern char makemap_command[VALSIZE];
|
|
+extern char qsheff_rules_file[VALSIZE];
|
|
+extern char trim_subj_str[VALSIZE];
|
|
|
|
void
|
|
loadconfig(const char *);
|