← Back to team overview

libgse team mailing list archive

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

 

** Also affects: libgse/1.0.x
   Importance: Undecided
       Status: New

** Also affects: libgse/trunk
   Importance: Undecided
       Status: New

** Changed in: libgse/1.0.x
    Milestone: None => 1.0.2

** Changed in: libgse/trunk
    Milestone: None => 1.1.0

** Changed in: libgse/1.0.x
   Importance: Undecided => High

** Changed in: libgse/trunk
   Importance: Undecided => High

** Changed in: libgse/1.0.x
       Status: New => Confirmed

** Changed in: libgse/trunk
       Status: New => Incomplete

** Changed in: libgse/trunk
       Status: Incomplete => Confirmed

-- 
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:
  Confirmed
Status in libgse 1.0.x series:
  Confirmed
Status in libgse trunk series:
  Confirmed

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