• 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

0.0
/src/datasets-string.c
1
/* Copyright (C) 2017-2024 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
/**
19
 * \file
20
 *
21
 * \author Victor Julien <victor@inliniac.net>
22
 */
23

24
#include "suricata-common.h"
25
#include "conf.h"
26
#include "datasets.h"
27
#include "datasets-string.h"
28
#include "util-thash.h"
29
#include "util-print.h"
30
#include "util-hash-lookup3.h"
31
#include "rust.h"
32

33
#if 0
34
static int StringAsAscii(const void *s, char *out, size_t out_size)
35
{
36
    const StringType *str = s;
37
    uint32_t offset = 0;
38
    PrintRawUriBuf(out, &offset, out_size, str->ptr, str->len);
39
    if (out[0] == '\0')
40
        return 0;
41
    strlcat(out, "\n", out_size);
42
    return strlen(out);
43
}
44
#endif
45

46
int StringAsBase64(const void *s, char *out, size_t out_size)
47
{
×
48
    const StringType *str = s;
×
49

50
    unsigned long len = SCBase64EncodeBufferSize(str->len);
×
51
    if (len + 2 > out_size) {
×
52
        // linefeed and final zero : signal we need more space
53
        return (int)len + 2;
×
54
    }
×
55
    if (SCBase64Encode((unsigned char *)str->ptr, str->len, (uint8_t *)out, &len) != SC_BASE64_OK)
×
56
        return 0;
×
57

58
    strlcat(out, "\n", out_size);
×
59
    return (int)strlen(out);
×
60
}
×
61

62
int StringSet(void *dst, void *src)
63
{
×
64
    StringType *src_s = src;
×
65
    StringType *dst_s = dst;
×
66
    SCLogDebug("dst %p src %p, src_s->ptr %p src_s->len %u", dst, src, src_s->ptr, src_s->len);
×
67

68
    dst_s->len = src_s->len;
×
69
    dst_s->ptr = SCMalloc(dst_s->len);
×
70
    if (dst_s->ptr == NULL) {
×
71
        SCLogError("Failed to allocate memory for string of length %u", dst_s->len);
×
72
        return -1;
×
73
    }
×
74
    memcpy(dst_s->ptr, src_s->ptr, dst_s->len);
×
75

76
    dst_s->rep = src_s->rep;
×
77
    SCLogDebug("dst %p src %p, dst_s->ptr %p dst_s->len %u", dst, src, dst_s->ptr, dst_s->len);
×
78
    return 0;
×
79
}
×
80

81
int StringJsonSet(void *dst, void *src)
82
{
×
83
    if (StringSet(dst, src) < 0)
×
84
        return -1;
×
85

86
    StringType *src_s = src;
×
87
    StringType *dst_s = dst;
×
88

89
    if (DatajsonCopyJson(&dst_s->json, &src_s->json) < 0) {
×
90
        SCFree(dst_s->ptr);
×
91
        return -1;
×
92
    }
×
93

94
    return 0;
×
95
}
×
96

97
bool StringCompare(void *a, void *b)
98
{
×
99
    const StringType *as = a;
×
100
    const StringType *bs = b;
×
101

102
    if (as->len != bs->len)
×
103
        return false;
×
104

105
    return (memcmp(as->ptr, bs->ptr, as->len) == 0);
×
106
}
×
107

108
uint32_t StringHash(uint32_t hash_seed, void *s)
109
{
×
110
    StringType *str = s;
×
111
    return hashlittle_safe(str->ptr, str->len, hash_seed);
×
112
}
×
113

114
uint32_t StringGetLength(void *s)
115
{
×
116
    StringType *str = s;
×
117
    return str->len;
×
118
}
×
119

120
// base data stays in hash
121
void StringFree(void *s)
122
{
×
123
    StringType *str = s;
×
124
    SCFree(str->ptr);
×
125
}
×
126

127
void StringJsonFree(void *s)
128
{
×
129
    StringType *str = s;
×
130
    SCFree(str->ptr);
×
131
    if (str->json.value) {
×
132
        SCFree(str->json.value);
×
133
    }
×
134
}
×
135

136
uint32_t StringJsonGetLength(void *s)
137
{
×
138
    StringType *str = s;
×
139
    return str->json.len + str->len;
×
140
}
×
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