- a number of size_t fixes

- REGISTER response generated from siproxd must include
  a Contact header.

1. tell gcc that the logging functions use printf style
format strings. This gets gcc to tell us about a lot
of the problems.

2. size_t is not an int on AMD64, so don't treat it
like one. I've changed to use "%ld" format code and
cast to a long, which should work well enough.

3. some format strings didn't match the argument lists.
These fixes are pretty clear.

4. log_debug, log_error, log_warn, log_info could all
end up evaluating their varargs list multiple times if
the message was to be logged to multiple places. This
causes the second/third uses to access invalid memory
and potentially segfault. I fixed this by using
va_copy() to copy the varargs list for each use.
This commit is contained in:
Thomas Ries
2006-05-20 11:48:53 +00:00
parent 9e7b2efd15
commit 757f34b748
16 changed files with 121 additions and 93 deletions
+3 -3
View File
@@ -167,9 +167,9 @@ int process_aclist (char *aclist, struct sockaddr_in from) {
mask_int=atoi(mask);
bitmask= (mask_int)? (0xffffffff<<(32-mask_int)) : 0;
DEBUGC(DBCLASS_ACCESS,"[%i] (%p) <-> (%p)", i,
ntohl(inaddr.s_addr) & bitmask,
ntohl(from.sin_addr.s_addr) & bitmask);
DEBUGC(DBCLASS_ACCESS,"check match: entry=%i, filter=%lx, from=%lx", i,
(long)ntohl(inaddr.s_addr) & bitmask,
(long)ntohl(from.sin_addr.s_addr) & bitmask);
if ( (ntohl(inaddr.s_addr) & bitmask) ==
(ntohl(from.sin_addr.s_addr) & bitmask) ) return STS_SUCCESS;