From 17cd41c887f48b60b22e2d9e30d4ea1f6f08cfa0 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 2 Dec 2022 07:00:26 +0100 Subject: [PATCH] frames: suppress cppcheck warning src/app-layer-frames.c:471:5: warning: Identical condition 'stream_slice->input==NULL', second condition is always false [identicalConditionAfterEarlyExit] BUG_ON(stream_slice->input == NULL); ^ src/app-layer-frames.c:468:29: note: If condition 'stream_slice->input==NULL' is true, the function will return/exit if (stream_slice->input == NULL) ^ src/app-layer-frames.c:471:5: note: Testing identical condition 'stream_slice->input==NULL' BUG_ON(stream_slice->input == NULL); ^ src/app-layer-frames.c:548:5: warning: Identical condition 'stream_slice->input==NULL', second condition is always false [identicalConditionAfterEarlyExit] BUG_ON(stream_slice->input == NULL); ^ src/app-layer-frames.c:545:29: note: If condition 'stream_slice->input==NULL' is true, the function will return/exit if (stream_slice->input == NULL) ^ src/app-layer-frames.c:548:5: note: Testing identical condition 'stream_slice->input==NULL' BUG_ON(stream_slice->input == NULL); ^ --- src/app-layer-frames.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app-layer-frames.c b/src/app-layer-frames.c index 62e150eb34..95683a5c70 100644 --- a/src/app-layer-frames.c +++ b/src/app-layer-frames.c @@ -467,8 +467,9 @@ Frame *AppLayerFrameNewByRelativeOffset(Flow *f, const StreamSlice *stream_slice return NULL; if (stream_slice->input == NULL) return NULL; -#endif +#else BUG_ON(stream_slice->input == NULL); +#endif BUG_ON(f->proto == IPPROTO_TCP && f->protoctx == NULL); BUG_ON(f->alparser == NULL); @@ -544,8 +545,9 @@ Frame *AppLayerFrameNewByAbsoluteOffset(Flow *f, const StreamSlice *stream_slice return NULL; if (stream_slice->input == NULL) return NULL; -#endif +#else BUG_ON(stream_slice->input == NULL); +#endif BUG_ON(f->proto == IPPROTO_TCP && f->protoctx == NULL); BUG_ON(f->alparser == NULL); BUG_ON(frame_start < stream_slice->offset); -- 2.47.2