• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OISF / suricata / 22550902417

01 Mar 2026 07:32PM UTC coverage: 68.401% (-5.3%) from 73.687%
22550902417

Pull #14922

github

web-flow
github-actions: bump actions/upload-artifact from 6.0.0 to 7.0.0

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #14922: github-actions: bump actions/upload-artifact from 6.0.0 to 7.0.0

218243 of 319063 relevant lines covered (68.4%)

3284926.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

39.02
/rust/src/pgsql/detect.rs
1
/* Copyright (C) 2025 Open Information Security Foundation
2
 *
3
 * You can copy, redistribute or modify this Program under the terms of
4
 * the GNU General Public License version 2 as published by the Free
5
 * Software Foundation.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 * GNU General Public License for more details.
11
 *
12
 * You should have received a copy of the GNU General Public License
13
 * version 2 along with this program; if not, write to the Free Software
14
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15
 * 02110-1301, USA.
16
 */
17

18
// written by Juliana Fajardini <jufajardini@oisf.net>
19

20
use super::pgsql::{PgsqlTransaction, ALPROTO_PGSQL};
21
use crate::pgsql::parser::PgsqlFEMessage;
22
use crate::core::{STREAM_TOSERVER};
23
use crate::detect::{helper_keyword_register_sticky_buffer, SigTableElmtStickyBuffer};
24
use suricata_sys::sys::{
25
    DetectEngineCtx, SCDetectBufferSetActiveList, SCDetectHelperBufferMpmRegister, SCDetectSignatureSetAppProto,
26
    Signature,
27
};
28
use std::os::raw::{c_int, c_void};
29

30
static mut G_PGSQL_QUERY_BUFFER_ID: c_int = 0;
31

32
unsafe extern "C" fn pgsql_detect_query_setup(
×
33
    de: *mut DetectEngineCtx, s: *mut Signature, _raw: *const std::os::raw::c_char,) -> c_int
×
34
{
×
35
    if SCDetectSignatureSetAppProto(s, ALPROTO_PGSQL) != 0 {
×
36
        return - 1;
×
37
    }
×
38
    if SCDetectBufferSetActiveList(de, s, G_PGSQL_QUERY_BUFFER_ID) < 0 {
×
39
        return - 1;
×
40
    }
×
41
    0
×
42
}
×
43

44
unsafe extern "C" fn pgsql_detect_query_get_data(
×
45
    tx: *const c_void, _flags: u8, buffer: *mut *const u8, buffer_len: *mut u32,
×
46
) -> bool {
×
47
    let tx = cast_pointer!(tx, PgsqlTransaction);
×
48

49
    for request in &tx.requests {
×
50
        if let PgsqlFEMessage::SimpleQuery(ref query) = request {
×
51
            *buffer = query.payload.as_ptr();
×
52
            *buffer_len = query.payload.len() as u32;
×
53
            return true;
×
54
        }
×
55
    }
56

57
    *buffer = std::ptr::null();
×
58
    *buffer_len = 0;
×
59
    false
×
60
}
×
61

62
#[no_mangle]
63
pub unsafe extern "C" fn SCDetectPgsqlRegister() {
37✔
64
    let kw = SigTableElmtStickyBuffer {
37✔
65
        name: String::from("pgsql.query"),
37✔
66
        desc: String::from("match PGSQL  query request content"),
37✔
67
        url: String::from("/rules/pgsql-keywords.html#pgsql.query"),
37✔
68
        setup: pgsql_detect_query_setup,
37✔
69
    };
37✔
70
    let _g_pgsql_query_kw_id = helper_keyword_register_sticky_buffer(&kw);
37✔
71
    G_PGSQL_QUERY_BUFFER_ID = SCDetectHelperBufferMpmRegister(
37✔
72
        b"pgsql.query\0".as_ptr() as *const libc::c_char,
37✔
73
        b"pgsql query request content\0".as_ptr() as *const libc::c_char,
37✔
74
        ALPROTO_PGSQL,
37✔
75
        STREAM_TOSERVER,
37✔
76
        Some(pgsql_detect_query_get_data),
37✔
77
    );
37✔
78
}
37✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc