File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 11/*
22 * ProFTPD - mod_proxy reverse datastore implementation
3- * Copyright (c) 2012-2021 TJ Saunders
3+ * Copyright (c) 2012-2025 TJ Saunders
44 *
55 * This program is free software; you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
@@ -1507,10 +1507,21 @@ static const struct proxy_conn *reverse_db_policy_next_backend(pool *p,
15071507
15081508 if (proxy_reverse_policy_is_sticky (policy_id ) != TRUE) {
15091509 if (conns == NULL &&
1510- default_backends != NULL &&
15111510 db_backends == NULL ) {
1512- conns = default_backends -> elts ;
1513- nelts = default_backends -> nelts ;
1511+
1512+ if (default_backends != NULL ) {
1513+ conns = default_backends -> elts ;
1514+ nelts = default_backends -> nelts ;
1515+
1516+ } else {
1517+ /* Prevent possible null pointer dereferences later due to missing
1518+ * default URIs for non-sticky ConnectPolicy configurations.
1519+ */
1520+ pr_log_writefile (proxy_logfd , MOD_PROXY_VERSION ,
1521+ "missing required default/global ProxyReverseServers" );
1522+ errno = EPERM ;
1523+ return NULL ;
1524+ }
15141525 }
15151526 }
15161527
You can’t perform that action at this time.
0 commit comments