[OpenSIPS-Devel] [OpenSIPS/opensips] 4c5275: proto_bin: fix crash when parsed data is printed o...

Răzvan Crainea noreply at github.com
Thu Aug 19 14:05:03 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 4c52754b8cb2ade4f877d6a03c4b84d84608d49a
      https://github.com/OpenSIPS/opensips/commit/4c52754b8cb2ade4f877d6a03c4b84d84608d49a
  Author: Razvan Crainea <razvan at opensips.org>
  Date:   2021-08-19 (Thu, 19 Aug 2021)

  Changed paths:
    M modules/proto_bin/proto_bin.c

  Log Message:
  -----------
  proto_bin: fix crash when parsed data is printed on error

The module was trying to print the parsed data in case of an error,
however it was using the `start` field of the tcp_conn. The problem is
that the module does not use the `start` field, therefore when a request
is not entirely read from the begining, it is not updated to point to
the new structure. Therefore, when we're trying to print the buffer, it
is pointing to an address on stack.
The fix for this bug was to suppress the parsed printing, as it is
binary anyway and it is the same value as the `buf`.

Many thanks to Bernard Buitenhuis for reporting the issue.





More information about the Devel mailing list