<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"Pr\00E9format\00E9 HTML Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.PrformatHTMLCar
{mso-style-name:"Pr\00E9format\00E9 HTML Car";
mso-style-priority:99;
mso-style-link:"Pr\00E9format\00E9 HTML";
font-family:"Courier New";}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=FR link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal> Hi
Ross,<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Using RTSPClient that have a task sending a periodic
GET_PARAMETER, sometimes a crash occurs with the following backtrace :<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Thread
1 (Thread 24732):<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>#0
__strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:31<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>#1
0x00000000008291b2 in RTSPClient::handleGET_PARAMETERResponse (this=0x7f6ae04d3490,
parameterName=0x7f6ad51aed00 "", resultValueString=@0x7f6abd3c1ee0)
at RTSPClient.cpp:1147<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>#2
0x000000000082b047 in RTSPClient::handleResponseBytes (this=0x7f6ae04d3490,
newBytesRead=86) at RTSPClient.cpp:1605<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>#3
0x0000000000829e8c in RTSPClient::incomingDataHandler1 (this=0x7f6ae04d3490) at
RTSPClient.cpp:1376<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>#4
0x0000000000829dff in RTSPClient::incomingDataHandler (instance=0x7f6ae04d3490)
at RTSPClient.cpp:1369<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>#5
0x000000000086b9cc in BasicTaskScheduler::SingleStep (this=0x7f6ac400f5c0, maxDelayTime=0)
at BasicTaskScheduler.cpp:146<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>#6
0x000000000086a184 in BasicTaskScheduler0::doEventLoop (this=0x7f6ac400f5c0,
watchVariable=0x7f6ae05f8d32 "") at BasicTaskScheduler0.cpp:81<o:p></o:p></span></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>In this context we are in <span style='font-size:10.0pt;
font-family:"Courier New"'>RTSPClient.cpp around 1555 :<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:35.4pt'> <o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'> //
If we saw a "Content-Length:" header, then make sure that we have the
amount of data that it specified:<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>
unsigned bodyOffset = nextLineStart - headerDataCopy;<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>
bodyStart = &fResponseBuffer[bodyOffset];<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>
numBodyBytes = fResponseBytesAlreadySeen - bodyOffset;<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'> if
(contentLength > numBodyBytes) {<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'><o:p> </o:p></p>
<p class=MsoNormal>Gdb says that nextLineStart is NULL, bodyOffset is a big
number, and finally bodyStart point a non allocated memory (that raise a SEGV).<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Do you think if is possible to add check nextLineStart before
using it :<o:p></o:p></p>
<p class=MsoNormal> if
(nextLineStart != 0)<o:p></o:p></p>
<p class=MsoNormal> {<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'> //
If we saw a "Content-Length:" header, then make sure that we have the
amount of data that it specified:<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>
unsigned bodyOffset = nextLineStart - headerDataCopy;<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>
bodyStart = &fResponseBuffer[bodyOffset];<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>
numBodyBytes = fResponseBytesAlreadySeen - bodyOffset;<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>….<o:p></o:p></p>
<p class=MsoNormal style='margin-left:35.4pt'>}<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal>Thanks & Regards,<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal> Michel.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<div>
<div>
<p class=MsoNormal>[@@THALES GROUP RESTRICTED@@]<o:p></o:p></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>