summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2026-05-22 11:46:33 +0000
committerFelix Fietkau2026-05-22 11:46:34 +0000
commitbd7599d021571e785bd32a75469e7148eb1772e3 (patch)
tree257ccc200f12fedababfb99f915edf9b079de885
parenta52cdb354d13c179150d2ba26f9f8a51d418b43d (diff)
downloadmdnsd-bd7599d021571e785bd32a75469e7148eb1772e3.tar.gz
fix calloc_a size argument type
Use size_t instead of int to prevent bogus overflow Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--cache.c4
-rw-r--r--service.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/cache.c b/cache.c
index 36fee9c..2c16d34 100644
--- a/cache.c
+++ b/cache.c
@@ -163,7 +163,7 @@ cache_update(void)
}
static struct cache_service*
-cache_service(struct interface *iface, char *entry, int hlen, int ttl)
+cache_service(struct interface *iface, char *entry, size_t hlen, int ttl)
{
struct cache_service *s, *t;
char *entry_buf;
@@ -261,7 +261,7 @@ void cache_answer(struct interface *iface, struct sockaddr *from, uint8_t *base,
{
struct dns_srv_data *dsd = (struct dns_srv_data *) rdata;
struct cache_record *r;
- int port = 0, dlen = 0, tlen = 0, nlen, rdlength;
+ size_t port = 0, dlen = 0, tlen = 0, nlen, rdlength;
char *p = NULL;
char *name_buf;
void *rdata_ptr, *txt_ptr;
diff --git a/service.c b/service.c
index 441ec2e..d9bb4ef 100644
--- a/service.c
+++ b/service.c
@@ -239,9 +239,9 @@ service_load_blob(struct blob_attr *b)
struct blob_attr *txt, *_tb[__SERVICE_MAX];
struct service *s;
char *d_instance, *d_hostname, *d_service, *d_id;
+ size_t txt_len = 0;
uint8_t *d_txt;
int rem2;
- int txt_len = 0;
unsigned int n;
blobmsg_parse(service_policy, ARRAY_SIZE(service_policy),