[Dnsmasq-discuss] Bug: Null pointer dereference in domain-match.c at line 82 (dnsmasq 2.92test21-1-gee09f06)
fuyulai2024
fuyulai2024 at 163.com
Mon Mar 9 13:24:44 UTC 2026
## Description
```
dnsmasq attempts to pass a null pointer (NULL) to a function in the domain-match.c file at line 82,
while the function's parameter is declared as nonnull (i.e., it must not be NULL).
As declared in the function's parameter attributes in C, the function expects to receive a non-null pointer.
However, dnsmasq passes a null pointer during the function call, which may lead to a program crash.
```
## Running Environment
```
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal
```
## Protocol Implementation Version
```
root at cbf1f9c04f26:~/dnsmasq/src# git log --oneline
ee09f06 (HEAD -> master, origin/master, origin/HEAD) Optimise tftp.
1e83316 (tag: v2.92test21) Formatting.
9a566c0 Tweak recently altered TFTP code.
```
## Build
```
export CC=afl-clang-fast
export CXX=afl-clang-fast++
make COPTS="-g -fsanitize=address,undefined -fno-omit-frame-pointer" LDFLAGS="-fsanitize=address,undefined"
```
## Logs
```
root at cbf1f9c04f26:~/dnsmasq/src# ./dnsmasq -p 5353 -d -C /root/dnsmasq/dnsmasq.conf -8 /var/log/dnsmasq/dnsmasq.log
pc_guard: [INIT] bitmap has been allocted from addr 8696316 to 8914568 [ 54563 bits - ratio: 100%]
lucky: [INIT] bitmap has been allocted from idx 1 to 54563
lucky: [INIT]inital edge cnt: 2119
Shared Memory: /dev/shm/cov_bitmap_dns
dnsmasq: started, version 2.92test21-1-gee09f06 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-UBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset no-nftset auth no-DNSSEC loop-detect inotify dumpfile
domain-match.c:82:9: runtime error: null pointer passed as argument 1, which is declared to never be null
/usr/include/stdlib.h:831:30: note: nonnull attribute specified here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior domain-match.c:82:9 in
dnsmasq: reading /etc/resolv.conf
dnsmasq: using nameserver 192.168.65.7#53
dnsmasq: read /etc/hosts - 9 names
```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20260309/b4d6c149/attachment-0001.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dnsmasq.conf
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20260309/b4d6c149/attachment-0001.ksh>
More information about the Dnsmasq-discuss
mailing list