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

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


  Branch: refs/heads/3.2
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 2232f6a33d067a3034231b9fb3b1480d41dfe56b
      https://github.com/OpenSIPS/opensips/commit/2232f6a33d067a3034231b9fb3b1480d41dfe56b
  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.

(cherry picked from commit 4c52754b8cb2ade4f877d6a03c4b84d84608d49a)





More information about the Devel mailing list