git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bugzilla #1106: Don't pass DKIM compound log line as format string
[exim.git]
/
src
/
src
/
expand.c
diff --git
a/src/src/expand.c
b/src/src/expand.c
index 1fd4335da70c74d1b2584f26e54e96f8ee5a0da9..2e59c4084e8d16990a31ff851983c5916fff10ec 100644
(file)
--- a/
src/src/expand.c
+++ b/
src/src/expand.c
@@
-328,9
+328,9
@@
enum {
/* Type for main variable table */
typedef struct {
/* Type for main variable table */
typedef struct {
- char *name;
- int type;
- void *value;
+ c
onst c
har *name;
+ int
type;
+ void
*value;
} var_entry;
/* Type for entries pointing to address/length pairs. Not currently
} var_entry;
/* Type for entries pointing to address/length pairs. Not currently
@@
-632,9
+632,9
@@
static BOOL malformed_header;
/* For textual hashes */
/* For textual hashes */
-static char *hashcodes = "abcdefghijklmnopqrtsuvwxyz"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "0123456789";
+static c
onst c
har *hashcodes = "abcdefghijklmnopqrtsuvwxyz"
+
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+
"0123456789";
enum { HMAC_MD5, HMAC_SHA1 };
enum { HMAC_MD5, HMAC_SHA1 };
@@
-2558,7
+2558,7
@@
switch(cond_type)
"value \"%s\"", t);
return NULL;
}
"value \"%s\"", t);
return NULL;
}
- if (yield != NULL) *yield = (boolvalue
!= 0
);
+ if (yield != NULL) *yield = (boolvalue
== testfor
);
return s;
}
return s;
}
@@
-3106,9
+3106,21
@@
if (*error == NULL)
int op = *s++;
int y = eval_op_unary(&s, decimal, error);
if (*error != NULL) break;
int op = *s++;
int y = eval_op_unary(&s, decimal, error);
if (*error != NULL) break;
- if (op == '*') x *= y;
- else if (op == '/') x /= y;
- else x %= y;
+ if (op == '*')
+ x *= y;
+ else
+ {
+ if (y == 0)
+ {
+ *error = (op == '/') ? US"divide by zero" : US"modulo by zero";
+ x = 0;
+ break;
+ }
+ if (op == '/')
+ x /= y;
+ else
+ x %= y;
+ }
}
}
*sptr = s;
}
}
*sptr = s;