]> git.ipfire.org Git - thirdparty/suricata.git/commit
app-layer: Set sc_errno upon error return
authorRichard McConnell <Richard_McConnell@rapid7.com>
Thu, 16 May 2024 09:04:24 +0000 (10:04 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 23 May 2024 15:27:38 +0000 (17:27 +0200)
commite87fe32bb165d8c807ac56fd0a3a2c9de9c688c2
treeb757372f4932319f493e13ceaeb8872dbfe7d9a8
parent87be155d0f194b6596a48fc94e55c010dea74322
app-layer: Set sc_errno upon error return

Bug: https://redmine.openinfosecfoundation.org/issues/6782

Callers to these allocators often use ``sc_errno`` to provide context of
the error. And in the case of the above bug, they return ``sc_errno``,
but as it has not been set ``sc_errno = 0; == SC_OK``.

This patch simply sets this variable to ensure there is context provided
upon error.

(cherry picked from commit fc2e49f84adcd471ca70c8e6aa82e2cf9f7b17ad)
src/app-layer-ftp.c
src/app-layer-htp-mem.c
src/util-streaming-buffer.c