diff options
| author | Felix Fietkau | 2026-05-22 11:46:33 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2026-05-22 11:46:34 +0000 |
| commit | bd7599d021571e785bd32a75469e7148eb1772e3 (patch) | |
| tree | 257ccc200f12fedababfb99f915edf9b079de885 | |
| parent | a52cdb354d13c179150d2ba26f9f8a51d418b43d (diff) | |
| download | mdnsd-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.c | 4 | ||||
| -rw-r--r-- | service.c | 2 |
2 files changed, 3 insertions, 3 deletions
@@ -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; @@ -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), |