Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app-layer-ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static AppLayerResult FTPGetLineForDirection(
if (input->len <= 0)
return APP_LAYER_ERROR;

uint8_t *lf_idx = memchr(input->buf + input->consumed, 0x0a, input->len);
const uint8_t *lf_idx = memchr(input->buf + input->consumed, 0x0a, input->len);

if (lf_idx == NULL) {
if (!(*current_line_truncated) && (uint32_t)input->len >= ftp_max_line_len) {
Expand Down Expand Up @@ -1375,7 +1375,7 @@ uint16_t JsonGetNextLineFromBuffer(const char *buffer, const uint16_t len)
return UINT16_MAX;
}

char *c = strchr(buffer, '\n');
const char *c = strchr(buffer, '\n');
return c == NULL ? len : (uint16_t)(c - buffer + 1);
}

Expand Down
2 changes: 1 addition & 1 deletion src/app-layer-smtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ static AppLayerResult SMTPGetLine(Flow *f, StreamSlice *slice, SMTPState *state,
}
SCLogDebug("frame %p", frame);

uint8_t *lf_idx = memchr(input->buf + input->consumed, 0x0a, input->len);
const uint8_t *lf_idx = memchr(input->buf + input->consumed, 0x0a, input->len);
bool discard_till_lf = (direction == 0) ? state->discard_till_lf_ts : state->discard_till_lf_tc;

if (lf_idx == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion src/conf-yaml-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Mangle(char *string)
static void
ConfYamlSetConfDirname(const char *filename)
{
char *ep;
const char *ep;

ep = strrchr(filename, '\\');
if (ep == NULL)
Expand Down
2 changes: 1 addition & 1 deletion src/datasets.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static int DatasetLoadIPv4(Dataset *set)
int DatasetParseIpv6String(Dataset *set, const char *line, struct in6_addr *in6)
{
/* Checking IPv6 case */
char *got_colon = strchr(line, ':');
const char *got_colon = strchr(line, ':');
if (got_colon) {
uint32_t ip6addr[4];
if (inet_pton(AF_INET6, line, in6) != 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ void DecodeRegisterPerfCounters(DecodeThreadVars *dtv, ThreadVars *tv)
}

char name[256];
char *dot = strchr(DEvents[i].event_name, '.');
const char *dot = strchr(DEvents[i].event_name, '.');
BUG_ON(!dot);
snprintf(name, sizeof(name), "%s.%s",
stats_decoder_events_prefix, dot+1);
Expand Down
2 changes: 1 addition & 1 deletion src/detect-app-layer-protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static DetectAppLayerProtocolData *DetectAppLayerProtocolParse(const char *arg,
AppProto alproto = ALPROTO_UNKNOWN;

char alproto_copy[MAX_ALPROTO_NAME];
char *sep = strchr(arg, ',');
const char *sep = strchr(arg, ',');
char *alproto_name;
if (sep && sep - arg < MAX_ALPROTO_NAME) {
strlcpy(alproto_copy, arg, sep - arg + 1);
Expand Down
6 changes: 3 additions & 3 deletions src/detect-pcre.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,9 @@ static DetectPcreData *DetectPcreParse (DetectEngineCtx *de_ctx,
bool apply_match_limit = false;

int cut_capture = 0;
char *fcap = strstr(regexstr, "flow:");
char *pcap = strstr(regexstr, "pkt:");
char *acap = strstr(regexstr, "alert:");
const char *fcap = strstr(regexstr, "flow:");
const char *pcap = strstr(regexstr, "pkt:");
const char *acap = strstr(regexstr, "alert:");
/* take the size of the whole input as buffer size for the regex we will
* extract below. Add 1 to please Coverity's alloc_strlen test. */
size_t slen = strlen(regexstr) + 1;
Expand Down
2 changes: 1 addition & 1 deletion src/util-logopenfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ static bool LogFileThreadedName(
}

/* Check if basename has an extension */
char *dot = strrchr(base, '.');
const char *dot = strrchr(base, '.');
if (dot) {
char *tname = SCStrdup(original_name);
if (!tname) {
Expand Down
2 changes: 1 addition & 1 deletion src/util-magic.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ static int MagicDetectTest07(void)
result = MagicThreadLookup(&ctx, buffer, buffer_len);
FAIL_IF_NULL(result);

char *str = strstr(result, "OpenDocument Text");
const char *str = strstr(result, "OpenDocument Text");
FAIL_IF_NULL(str);

MagicDeinitContext(ctx);
Expand Down
2 changes: 1 addition & 1 deletion src/util-path.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const char *SCBasename(const char *path)
if (!path || strlen(path) == 0)
return NULL;

char *final = strrchr(path, DIRECTORY_SEPARATOR);
const char *final = strrchr(path, DIRECTORY_SEPARATOR);
if (!final)
return path;

Expand Down
Loading