← Back to team overview

libgse team mailing list archive

[Bug 1211729] Re: Packet modified before checks are done on required length

 

** Summary changed:

- Packet modified before checks are done on required lenght
+ Packet modified before checks are done on required length

-- 
You received this bug notification because you are a member of GSE,
which is subscribed to libgse.
https://bugs.launchpad.net/bugs/1211729

Title:
  Packet modified before checks are done on required length

Status in GSE (Generic Stream Encapsulation) library:
  New

Bug description:
  When asking for a packet (with function gse_encap_get_packet()), with
  a header extension builder set up, the packet will be modified before
  any checks on its actual size: see http://bazaar.launchpad.net
  /~opensand-maintainers/libgse/trunk/view/head:/src/encap/encap.c#L725
  and http://bazaar.launchpad.net/~opensand-
  maintainers/libgse/trunk/view/head:/src/encap/encap.c#L730, with test
  occuring at http://bazaar.launchpad.net/~opensand-
  maintainers/libgse/trunk/view/head:/src/encap/encap.c#L775.

  As a consequence, if the required length is too small for the packet
  to fit (eg. < 10 bytes), the library will then returns an error
  (GSE_STATUS_LENGTH_TOO_SMALL), but the packet stored in the context
  will keep the modification (copy of header extensions and vfrag
  shifted).

  This behaviour is unexpected, and vfrag shifting and copy of header
  extensions shall be done after all necessary checks on packet length,
  or shall be reverted if packet does not fit (for example, in the
  'packet_null' error handler at http://bazaar.launchpad.net/~opensand-
  maintainers/libgse/trunk/view/head:/src/encap/encap.c#L871).

To manage notifications about this bug go to:
https://bugs.launchpad.net/libgse/+bug/1211729/+subscriptions


References