<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Could you please post it on the tracker(.iptel.org)?<br>
Please also include details on the OS and architecture.<br>
g-)<br>
<br>
Tomasz Zieleniewski wrote:
<blockquote
 cite="mid:5fd52d7a0712020938m5794fa22p454c4ece879c3802@mail.gmail.com"
 type="cite">Hi,<br>
  <br>
I was trying to set up media proxy module and after some time of
debuging I discovered that the problems<br>
were in the get_from_did(&amp;did, msg) function. in mediaproxy.c file
in line 469 there is such piece of code:
  <br>
&nbsp;&nbsp;&nbsp; if (get_from_did(&amp;did, msg) == 0) {<br>
&nbsp;&nbsp; *type = "local";<br>
&nbsp;&nbsp; return did;<br>
&nbsp;&nbsp;&nbsp; }<br>
  <br>
when this code is invoked the result is wrong. this is some nowhere
pointer with the length of the field unpredictable.
  <br>
after this invocation there is another piece of code wich tries to
allocate some memory baseing on the length of the did string.(line 1449)<br>
&nbsp;&nbsp;&nbsp; cmdlen = callId.len + strlen(clientIP) + fromDomain.len +
toDomain.len +<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; userAgent.len*3 + infolen + 128;<br>
&nbsp;&nbsp; command = pkg_malloc(cmdlen);<br>
&nbsp;&nbsp;&nbsp; if (!command) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOG(L_ERR, "error: use_media_proxy() - (!command): out of
memory\n");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return -1;<br>
&nbsp;&nbsp;&nbsp; }<br>
  <br>
this causes out of memory error when value of fromDomain.len gives
random big number(below example of one my shots)<br>
Dec&nbsp; 2 18:17:17 rd ser[5884]:&nbsp; route[MEDIA]: use_media_proxy()<br>
Dec&nbsp; 2 18:17:17 rd ser[5884]: error: get_from_did - true
  <br>
Dec&nbsp; 2 18:17:17 rd ser[5884]: error: callId.len: 44<br>
Dec&nbsp; 2 18:17:17 rd ser[5884]: error: strlen(clientIP): 14<br>
Dec&nbsp; 2 18:17:17 rd ser[5884]: error: fromDomain.len: 1235653920<br>
Dec&nbsp; 2 18:17:17 rd ser[5884]: error: toDomain.len: 14<br>
Dec&nbsp; 2 18:17:17 rd ser[5884]: error: userAgent.len*3: 96<br>
Dec&nbsp; 2 18:17:17 rd ser[5884]: error: infolen: 107<br>
Dec&nbsp; 2 18:17:17 rd ser[5884]: error: cmdlen 1235654349<br>
Dec&nbsp; 2 18:17:17 rd ser[5884]: error: use_media_proxy() - (!command):
out of memory
  <br>
  <br>
please, can someone check this and fix<br>
  <br>
best regards<br>
tomasz<br>
  <br>
  <br>
  <br>
  <br>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Serdev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Serdev@lists.iptel.org">Serdev@lists.iptel.org</a>
<a class="moz-txt-link-freetext" href="http://lists.iptel.org/mailman/listinfo/serdev">http://lists.iptel.org/mailman/listinfo/serdev</a>
  </pre>
</blockquote>
</body>
</html>