]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Ensure that ALL fields of the ap_listen_rec structure are initialized
authorRuediger Pluem <rpluem@apache.org>
Tue, 3 Jun 2025 15:12:14 +0000 (15:12 +0000)
committerRuediger Pluem <rpluem@apache.org>
Tue, 3 Jun 2025 15:12:14 +0000 (15:12 +0000)
alloc_listener initializes more fields in the created ap_listen_rec structure
than alloc_systemd_listener as it has more data to add to this structure.
Ensure that all fields of the ap_listen_rec structure are initialized at
least with 0 as later code using this structure depends on this.

Submitted by: jailletc36

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1926091 13f79535-47bb-0310-9956-ffa450edef68

server/listen.c

index cee11943b2dc980398a1954d2edce23b0b52066c..668b627171c597f5a217f536c2bb401d92850b6d 100644 (file)
@@ -333,9 +333,7 @@ static apr_status_t alloc_systemd_listener(process_rec * process,
     si.type = SOCK_STREAM;
     si.protocol = APR_PROTO_TCP;
 
-    rec = apr_palloc(process->pool, sizeof(ap_listen_rec));
-    rec->active = 0;
-    rec->next = 0;
+    rec = apr_pcalloc(process->pool, sizeof(ap_listen_rec));
 
     rv = apr_os_sock_make(&rec->sd, &si, process->pool);
     if (rv != APR_SUCCESS) {