Bug#300938: siproxd: FTBFS (amd64/gcc-4.0): too few arguments to function 'osip_message_parse'

Andreas Jochens Andreas Jochens <aj@andaco.de>, 300938@bugs.debian.org
Tue, 22 Mar 2005 20:55:36 +0100


Package: siproxd
Severity: normal
Tags: patch

When building 'siproxd' on amd64 with gcc-4.0,
I get the following error:

if cc -DHAVE_CONFIG_H -I. -I. -I..   -I/usr/include -Wall -D_GNU_SOURCE -DBUILDSTR="\"`cat .buildno`\"" -g -Wall -O2 -pthread -D_POSIX_THREAD_SAFE_FUNCTIONS -MT siproxd.o -MD -MP -MF ".deps/siproxd.Tpo" \
  -c -o siproxd.o `test -f 'siproxd.c' || echo './'`siproxd.c; \
then mv -f ".deps/siproxd.Tpo" ".deps/siproxd.Po"; \
else rm -f ".deps/siproxd.Tpo"; exit 1; \
fi
siproxd.c: In function 'main':
siproxd.c:332: error: too few arguments to function 'osip_message_parse'
make[3]: *** [siproxd.o] Error 1
make[3]: Leaving directory `/siproxd-0.5.10/src'

With the attached patch 'siproxd' can be compiled
on amd64 using gcc-4.0.

Regards
Andreas Jochens

diff -urN ../tmp-orig/siproxd-0.5.10/src/proxy.c ./src/proxy.c
--- ../tmp-orig/siproxd-0.5.10/src/proxy.c	2005-01-24 20:12:40.000000000 +0100
+++ ./src/proxy.c	2005-03-22 16:53:40.606097320 +0100
@@ -516,7 +516,7 @@
    * RFC 3261, Section 16.6 step 10
    * Proxy Behavior - Forward the new request
    */
-   sts = osip_message_to_str(request, &buffer);
+   sts = osip_message_to_str(request, &buffer, strlen(buffer));
    if (sts != 0) {
       ERROR("proxy_request: osip_message_to_str failed");
       return STS_FAILURE;
@@ -910,7 +910,7 @@
       }
    }
 
-   sts = osip_message_to_str(response, &buffer);
+   sts = osip_message_to_str(response, &buffer, strlen(buffer));
    if (sts != 0) {
       ERROR("proxy_response: osip_message_to_str failed");
       return STS_FAILURE;
@@ -966,7 +966,7 @@
       }
    }
 
-   sts = osip_body_to_str(body, &bodybuff);
+   sts = osip_body_to_str(body, &bodybuff, strlen(&bodybuff));
    sts = sdp_message_init(&sdp);
    sts = sdp_message_parse (sdp, bodybuff);
    osip_free(bodybuff);
@@ -981,7 +981,7 @@
 { /* just dump the buffer */
    char *tmp, *tmp2;
    sts = osip_message_get_body(mymsg, 0, &body);
-   sts = osip_body_to_str(body, &tmp);
+   sts = osip_body_to_str(body, &tmp, strlen(tmp));
    osip_content_length_to_str(mymsg->content_length, &tmp2);
    DEBUG("Body before rewrite (clen=%s, strlen=%i):\n%s\n----",
          tmp2, strlen(tmp), tmp);
@@ -1210,7 +1210,7 @@
    sdp_message_free(sdp);
 
    /* include new body */
-   osip_message_set_body(mymsg, bodybuff);
+   osip_message_set_body(mymsg, bodybuff, strlen(bodybuff));
 
    /* free content length resource and include new one*/
    osip_content_length_free(mymsg->content_length);
@@ -1225,7 +1225,7 @@
 { /* just dump the buffer */
    char *tmp, *tmp2;
    sts = osip_message_get_body(mymsg, 0, &body);
-   sts = osip_body_to_str(body, &tmp);
+   sts = osip_body_to_str(body, &tmp, strlen(&tmp));
    osip_content_length_to_str(mymsg->content_length, &tmp2);
    DEBUG("Body after rewrite (clen=%s, strlen=%i):\n%s\n----",
          tmp2, strlen(tmp), tmp);
diff -urN ../tmp-orig/siproxd-0.5.10/src/register.c ./src/register.c
--- ../tmp-orig/siproxd-0.5.10/src/register.c	2005-01-08 11:05:12.000000000 +0100
+++ ./src/register.c	2005-03-22 16:53:57.293874812 +0100
@@ -550,7 +550,7 @@
       }
    }   
 
-   sts = osip_message_to_str(response, &buffer);
+   sts = osip_message_to_str(response, &buffer, strlen(&buffer));
    if (sts != 0) {
       ERROR("register_response: msg_2char failed");
       return STS_FAILURE;
diff -urN ../tmp-orig/siproxd-0.5.10/src/sip_utils.c ./src/sip_utils.c
--- ../tmp-orig/siproxd-0.5.10/src/sip_utils.c	2005-01-08 11:05:13.000000000 +0100
+++ ./src/sip_utils.c	2005-03-22 16:54:44.297798071 +0100
@@ -563,7 +563,7 @@
       }
    }   
 
-   sts = osip_message_to_str(response, &buffer);
+   sts = osip_message_to_str(response, &buffer, strlen(&buffer));
    if (sts != 0) {
       ERROR("sip_gen_response: msg_2char failed");
       return STS_FAILURE;
diff -urN ../tmp-orig/siproxd-0.5.10/src/siproxd.c ./src/siproxd.c
--- ../tmp-orig/siproxd-0.5.10/src/siproxd.c	2005-01-08 11:41:46.000000000 +0100
+++ ./src/siproxd.c	2005-03-22 16:51:10.871011947 +0100
@@ -321,7 +321,7 @@
        * Proxy Behavior - Request Validation - Reasonable Syntax
        * (parse the received message)
        */
-      sts=osip_message_parse(ticket.sipmsg, buff);
+      sts=osip_message_parse(ticket.sipmsg, buff, strlen(buff));
       if (sts != 0) {
          ERROR("osip_message_parse() failed... this is not good");
          DUMP_BUFFER(-1, buff, i);