OpenIPC / majestic

Majestic Community edition integration kit
MIT License
35 stars 5 forks source link

Segmentation fault after bad ONVIF request #207

Open sansarus opened 1 week ago

sansarus commented 1 week ago

Required information

Issue description

Tried to ask StreamUri via ONVIF Device Test Tool v20.12 rev.6434
and Majestic died with Segmentation fault (core dumped)

template onvif request !!!without selected Profile Token!!!

Request:

POST /onvif/media_service HTTP/1.1
Host: 192.168.220.74
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 344

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <GetStreamUri xmlns="http://www.onvif.org/ver20/media/wsdl">
      <Protocol>RTSP</Protocol>
      <ProfileToken />
    </GetStreamUri>
  </s:Body>
</s:Envelope>`

Correct request with Profile Token work good

Request:

POST /onvif/media_service HTTP/1.1
Host: 192.168.220.74
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 373

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <GetStreamUri xmlns="http://www.onvif.org/ver20/media/wsdl">
      <Protocol>RTSP</Protocol>
      <ProfileToken>MainStreamToken</ProfileToken> ////!!!!!!!!
    </GetStreamUri>
  </s:Body>
</s:Envelope>
sansarus commented 1 week ago

majestic.2184.11.1728464569.core.zip

flyrouter commented 1 week ago

Thank you very much for the report We will definitely check this and try to fix it.