Various fixes to content GCC 16...

This commit is contained in:
Philippe Teuwen
2026-02-07 00:51:53 +01:00
parent d62e3cff15
commit fdf3b2690a
7 changed files with 17 additions and 12 deletions
+4 -1
View File
@@ -493,7 +493,7 @@ parse_long_options(char *const *nargv, const char *options,
static int
getopt_internal(int nargc, char *const *nargv, const char *options,
const struct option *long_options, int *idx, int flags) {
char *oli; /* option letter list index */
const char *oli; /* option letter list index */
int optchar, short_too;
static int posixly_correct = -1;
#ifdef __STDC_WANT_SECURE_LIB__
@@ -3607,6 +3607,9 @@ TRex *trex_compile(const TRexChar *pattern, const TRexChar **error, int flags) {
exp->_eol = exp->_bol = NULL;
exp->_p = pattern;
exp->_jmpbuf = NULL;
exp->_nodes = NULL;
exp->_matches = NULL;
exp->_nallocated = (int)scstrlen(pattern) * sizeof(TRexChar);
exp->_nodes = (TRexNode *)malloc(exp->_nallocated * sizeof(TRexNode));
+1 -1
View File
@@ -398,7 +398,7 @@ uint8_t *get_uid_from_filename(const char *filename) {
return uid;
}
char *found = strstr(filename, "hf-14b-");
const char *found = strstr(filename, "hf-14b-");
if (found == NULL) {
PrintAndLogEx(ERR, "can't get uid from filename `" _YELLOW_("%s") "` expected format is hf-14b-<uid>...", filename);
return uid;
+1 -2
View File
@@ -188,8 +188,7 @@ void printEM410x(uint32_t hi, uint64_t id, bool verbose, int type) {
uint32_t p1id = (id & 0xFFFFFF);
uint8_t arr[32] = {0x00};
int j = 23;
for (int k = 0 ; k < 24; ++k, --j) {
for (int k = 0 ; k < 24; ++k) {
arr[k] = (p1id >> k) & 1;
}
+1 -1
View File
@@ -110,7 +110,7 @@ static int asn1_tlv_compare(const void *a, const void *b) {
}
static const struct asn1_tag *asn1_get_tag(const struct tlv *tlv) {
struct asn1_tag *tag = bsearch(tlv, asn1_tags, ARRAYLEN(asn1_tags), sizeof(asn1_tags[0]), asn1_tlv_compare);
const struct asn1_tag *tag = bsearch(tlv, asn1_tags, ARRAYLEN(asn1_tags), sizeof(asn1_tags[0]), asn1_tlv_compare);
return tag ? tag : &asn1_tags[0];
}
+1 -1
View File
@@ -443,7 +443,7 @@ static int emv_tlv_compare(const void *a, const void *b) {
}
static const struct emv_tag *emv_get_tag(const struct tlv *tlv) {
struct emv_tag *tag = bsearch(tlv, emv_tags, ARRAYLEN(emv_tags),
const struct emv_tag *tag = bsearch(tlv, emv_tags, ARRAYLEN(emv_tags),
sizeof(emv_tags[0]), emv_tlv_compare);
return tag ? tag : &emv_tags[0];
+1 -1
View File
@@ -97,7 +97,7 @@ typedef struct {
}; \
const char* KSX6924Lookup ## NAME ( \
KEY_TYPE key, const char* defaultValue) { \
struct _ksx6924_enum_ ## KEY_TYPE *r = bsearch( \
const struct _ksx6924_enum_ ## KEY_TYPE *r = bsearch( \
&key, KSX6924_ENUM_ ## NAME, \
ARRAYLEN(KSX6924_ENUM_ ## NAME), \
sizeof(KSX6924_ENUM_ ## NAME [0]), \
+8 -5
View File
@@ -365,12 +365,15 @@ int mbedtls_sha512_update_ret(mbedtls_sha512_context *ctx,
left = 0;
}
while (ilen >= 128) {
if ((ret = mbedtls_internal_sha512_process(ctx, input)) != 0)
return (ret);
// extra guard here is just to satisfy GCC 16 static analysis
if (ilen >= 128) {
while (ilen >= 128) {
if ((ret = mbedtls_internal_sha512_process(ctx, input)) != 0)
return (ret);
input += 128;
ilen -= 128;
input += 128;
ilen -= 128;
}
}
if (ilen > 0)