Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package openfortivpn for openSUSE:Factory checked in at 2026-11-28 23:25:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/openfortivpn (Old) and /work/SRC/openSUSE:Factory/.openfortivpn.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openfortivpn" Sat Nov 28 23:25:29 2026 rev:33 rq:1401275 version:1.24.2 Changes: -------- --- /work/SRC/openSUSE:Factory/openfortivpn/openfortivpn.changes 2026-03-17 19:05:41.223629436 +0100 +++ /work/SRC/openSUSE:Factory/.openfortivpn.new.1340718/openfortivpn.changes 2026-11-28 23:27:10.971398319 +0100 @@ -1,0 +2,15 @@ +Sat Nov 28 09:21:00 UTC 2026 - Martin Hauke <[email protected]> + +- Update to version 1.24.2 + * Use gateway response to determine authentication status. + * IO: do not let a bad packet forge whole lines in the raw dump. + * XML: refuse non-printable characters in values, and handle a + refused dns value. + * HTTP: do not call strlen() on a missing action url value. + * IO: fix one-byte out-of-bounds write when logging a bad packet. + * HTTP: do not abort on a response that exactly fills the buffer. + * IO: bound the packet queues between the TLS and pppd threads. + * HTTP: cap the size of a gateway response at 8 MiB. + * HTTP: keep only printable ASCII in the gateway's OTP prompt. + +------------------------------------------------------------------- Old: ---- openfortivpn-1.24.1.tar.gz New: ---- openfortivpn-1.24.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ openfortivpn.spec ++++++ --- /var/tmp/diff_new_pack.H9LWlC/_old 2026-11-28 23:27:11.620425427 +0100 +++ /var/tmp/diff_new_pack.H9LWlC/_new 2026-11-28 23:27:11.622425510 +0100 @@ -17,7 +17,7 @@ Name: openfortivpn -Version: 1.24.1 +Version: 1.24.2 Release: 0 Summary: Client for PPP+SSL VPN tunnel services License: GPL-3.0-or-later ++++++ openfortivpn-1.24.1.tar.gz -> openfortivpn-1.24.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openfortivpn-1.24.1/.github/workflows/codeql-analysis.yml new/openfortivpn-1.24.2/.github/workflows/codeql-analysis.yml --- old/openfortivpn-1.24.1/.github/workflows/codeql-analysis.yml 2026-01-11 13:11:14.000000000 +0100 +++ new/openfortivpn-1.24.2/.github/workflows/codeql-analysis.yml 2026-11-27 10:35:10.000000000 +0100 @@ -33,11 +33,11 @@ steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v4 + uses: github/codeql-action/[email protected] # Override language selection by uncommenting this and choosing your languages # with: # languages: go, javascript, csharp, python, cpp, java @@ -48,7 +48,7 @@ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below). - name: Autobuild - uses: github/codeql-action/autobuild@v4 + uses: github/codeql-action/[email protected] # âšī¸ Command-line programs to run using the OS shell. # đ See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -62,4 +62,4 @@ # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v4 + uses: github/codeql-action/[email protected] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openfortivpn-1.24.1/.github/workflows/codespell.yml new/openfortivpn-1.24.2/.github/workflows/codespell.yml --- old/openfortivpn-1.24.1/.github/workflows/codespell.yml 2026-01-11 13:11:14.000000000 +0100 +++ new/openfortivpn-1.24.2/.github/workflows/codespell.yml 2026-11-27 10:35:10.000000000 +0100 @@ -14,7 +14,7 @@ runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: codespell-project/actions-codespell@master with: skip: .git,checkpatch.pl,spelling.txt,LICENSE.OpenSSL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openfortivpn-1.24.1/.github/workflows/coverity-scan.yml new/openfortivpn-1.24.2/.github/workflows/coverity-scan.yml --- old/openfortivpn-1.24.1/.github/workflows/coverity-scan.yml 2026-01-11 13:11:14.000000000 +0100 +++ new/openfortivpn-1.24.2/.github/workflows/coverity-scan.yml 2026-11-27 10:35:10.000000000 +0100 @@ -12,7 +12,7 @@ steps: - name: Checkout Code - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Download the Coverity Scan Build Tool run: | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openfortivpn-1.24.1/.github/workflows/openfortivpn.yml new/openfortivpn-1.24.2/.github/workflows/openfortivpn.yml --- old/openfortivpn-1.24.1/.github/workflows/openfortivpn.yml 2026-01-11 13:11:14.000000000 +0100 +++ new/openfortivpn-1.24.2/.github/workflows/openfortivpn.yml 2026-11-27 10:35:10.000000000 +0100 @@ -18,7 +18,7 @@ steps: - name: Checkout Code - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Install Dependencies run: sudo apt-get install -y astyle @@ -41,7 +41,7 @@ steps: - name: Checkout Code - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Install Dependencies run: | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openfortivpn-1.24.1/CHANGELOG.md new/openfortivpn-1.24.2/CHANGELOG.md --- old/openfortivpn-1.24.1/CHANGELOG.md 2026-01-11 13:11:14.000000000 +0100 +++ new/openfortivpn-1.24.2/CHANGELOG.md 2026-11-27 10:35:10.000000000 +0100 @@ -14,6 +14,18 @@ This high level changelog is usually updated when a release is tagged. On the master branch there may be changes that are not (yet) described here. +### 1.24.2 + +* [+] Use gateway response to determine authentication status +* [-] IO: do not let a bad packet forge whole lines in the raw dump +* [-] XML: refuse non-printable characters in values, and handle a refused dns value +* [-] HTTP: do not call strlen() on a missing action url value +* [-] IO: fix one-byte out-of-bounds write when logging a bad packet +* [-] HTTP: do not abort on a response that exactly fills the buffer +* [-] IO: bound the packet queues between the TLS and pppd threads +* [-] HTTP: cap the size of a gateway response at 8 MiB +* [-] HTTP: keep only printable ASCII in the gateway's OTP prompt + ### 1.24.1 * [-] fix regression where the `plugin` was not passed to pppd diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openfortivpn-1.24.1/configure.ac new/openfortivpn-1.24.2/configure.ac --- old/openfortivpn-1.24.1/configure.ac 2026-01-11 13:11:14.000000000 +0100 +++ new/openfortivpn-1.24.2/configure.ac 2026-11-27 10:35:10.000000000 +0100 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.63]) -AC_INIT([openfortivpn], [1.24.1]) +AC_INIT([openfortivpn], [1.24.2]) AC_CONFIG_SRCDIR([src/main.c]) AM_INIT_AUTOMAKE([foreign subdir-objects]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openfortivpn-1.24.1/src/config.c new/openfortivpn-1.24.2/src/config.c --- old/openfortivpn-1.24.1/src/config.c 2026-01-11 13:11:14.000000000 +0100 +++ new/openfortivpn-1.24.2/src/config.c 2026-11-27 10:35:10.000000000 +0100 @@ -100,7 +100,7 @@ new = malloc(sizeof(struct x509_digest)); if (new == NULL) - return ERR_CFG_NO_MEM; + return -errno; new->next = NULL; strncpy(new->data, digest, SHA256STRLEN - 1); @@ -194,7 +194,7 @@ file = fopen(filename, "r"); if (file == NULL) { - ret = ERR_CFG_SEE_ERRNO; + ret = -errno; goto err_return; } @@ -482,7 +482,7 @@ } } if (ferror(file)) - ret = ERR_CFG_SEE_ERRNO; + ret = -errno; err_free: free(line); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openfortivpn-1.24.1/src/config.h new/openfortivpn-1.24.2/src/config.h --- old/openfortivpn-1.24.1/src/config.h 2026-01-11 13:11:14.000000000 +0100 +++ new/openfortivpn-1.24.2/src/config.h 2026-11-27 10:35:10.000000000 +0100 @@ -25,25 +25,6 @@ #include <stdint.h> #include <string.h> -#define ERR_CFG_UNKNOWN -1 -#define ERR_CFG_SEE_ERRNO -2 -#define ERR_CFG_EMPTY_FILE -3 -#define ERR_CFG_NO_MEM -4 -#define ERR_CFG_CANNOT_READ -5 - -static inline const char *err_cfg_str(int code) -{ - if (code == ERR_CFG_SEE_ERRNO) - return strerror(errno); - else if (code == ERR_CFG_EMPTY_FILE) - return "Empty file"; - else if (code == ERR_CFG_NO_MEM) - return "Not enough memory"; - else if (code == ERR_CFG_CANNOT_READ) - return "Cannot read file"; - return "unknown"; -} - #if HAVE_USR_SBIN_PPPD #define PPP_DAEMON "pppd" #else @@ -64,6 +45,7 @@ #define OTP_SIZE 64 #define REALM_SIZE 63 #define PEM_PASSPHRASE_SIZE 31 +#define AUTH_RET_SIZE 3 /* Numeric value (e.g. "0", "1", "6") */ /* * RFC 6265 does not limit the size of cookies: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openfortivpn-1.24.1/src/http.c new/openfortivpn-1.24.2/src/http.c --- old/openfortivpn-1.24.1/src/http.c 2026-01-11 13:11:14.000000000 +0100 +++ new/openfortivpn-1.24.2/src/http.c 2026-11-27 10:35:10.000000000 +0100 @@ -37,6 +37,11 @@ * Initial size of the buffer for incoming HTTP responses. */ #define HTTP_BUFFER_SIZE 0x10000 +/* + * Gateway replies (login pages, the XML configuration) are kilobytes. Without + * a cap, a reply that never ends grows the buffer towards 4 GiB. + */ +#define HTTP_MAX_RESPONSE_SIZE (8U * 1024 * 1024) /* @@ -226,7 +231,9 @@ if (bytes_read == capacity) { char *new_buffer; - if ((UINT32_MAX - 1) / capacity < 2) { + if (capacity >= HTTP_MAX_RESPONSE_SIZE) { + log_error("Response from the gateway is larger than %u bytes.\n", + HTTP_MAX_RESPONSE_SIZE); free(buffer); return ERR_HTTP_TOO_LONG; } @@ -252,7 +259,11 @@ if (response == NULL) { free(buffer); } else { - assert(bytes_read < capacity); + // A complete response of exactly `capacity` bytes leaves + // bytes_read == capacity: the body-end check breaks the loop before + // the buffer is grown. buffer has capacity + 1 bytes, so the + // terminator below is still in bounds. + assert(bytes_read <= capacity); buffer[bytes_read] = '\0'; *response = buffer; @@ -392,6 +403,10 @@ if (strncmp(key, kv_pair, keylen) == 0) { const char *val = strtok_r(NULL, "\"\r\n", &saveptr); + if (val == NULL) { // key present but no value after it + ret = -1; + break; + } if (strlen(val) > retbuflen - 1) { // value too long ret = -2; } else { @@ -506,6 +521,13 @@ if (e - p + 1 < sizeof(prompt)) { strncpy(prompt, p, e - p); prompt[e - p] = '\0'; + /* + * The prompt is printed as-is: keep line breaks + * and other control bytes from the gateway out. + */ + for (char *c = prompt; *c; c++) + if (!printable_char(*c)) + *c = ' '; p = prompt; } else { p = NULL; @@ -637,6 +659,7 @@ char username[3 * USERNAME_SIZE + 1]; char password[3 * PASSWORD_SIZE + 1]; char realm[3 * REALM_SIZE + 1]; + char auth_ret_text[AUTH_RET_SIZE + 1]; char reqid[32] = { '\0' }; char polid[32] = { '\0' }; char group[128] = { '\0' }; @@ -714,6 +737,28 @@ if (ret != 1) goto end; + ret = get_value_from_response(res, "ret=", auth_ret_text, sizeof(auth_ret_text)); + if (ret == 1) { + int auth_ret = strtol(auth_ret_text, NULL, 10); + + switch (auth_ret) { + case 0: + log_error("Authentication failed\n"); + ret = ERR_HTTP_PERMISSION; + goto end; + case 1: + log_debug("Authentication succeeded\n"); + break; + case 6: + log_error("Gateway replied to authentication with an unsupported challenge\n"); + ret = ERR_HTTP_PERMISSION; + goto end; + default: + log_warn("Unknown authentication result: %d\n", auth_ret); + break; + } + } + /* Probably one-time password required */ if (strncmp(res, "HTTP/1.1 401 Authorization Required\r\n", 37) == 0) { delay_otp(tunnel); @@ -880,8 +925,9 @@ if (xml_find(' ', "domain=", val, 1)) { tunnel->ipv4.dns_suffix = xml_get(xml_find(' ', "domain=", val, 1)); - log_debug("Found dns suffix %s in xml config\n", - tunnel->ipv4.dns_suffix); + if (tunnel->ipv4.dns_suffix) + log_debug("Found dns suffix %s in xml config\n", + tunnel->ipv4.dns_suffix); break; } } @@ -891,6 +937,8 @@ while ((val = xml_find('<', "dns", val, 2))) { if (xml_find(' ', "ip=", val, 1)) { dns_server = xml_get(xml_find(' ', "ip=", val, 1)); + if (!dns_server) + continue; log_debug("Found dns server %s in xml config\n", dns_server); if (!tunnel->ipv4.ns1_addr.s_addr) tunnel->ipv4.ns1_addr.s_addr = inet_addr(dns_server); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openfortivpn-1.24.1/src/io.c new/openfortivpn-1.24.2/src/io.c --- old/openfortivpn-1.24.1/src/io.c 2026-01-11 13:11:14.000000000 +0100 +++ new/openfortivpn-1.24.2/src/io.c 2026-11-27 10:35:10.000000000 +0100 @@ -41,6 +41,7 @@ #include <limits.h> #include <signal.h> #include <string.h> +#include <sys/param.h> #if HAVE_MACH_MACH_H /* this is typical for mach kernel used on Mac OS X */ @@ -89,11 +90,11 @@ static void init_ssl_locks(void) { lockarray = (pthread_mutex_t *) OPENSSL_malloc(CRYPTO_num_locks() * - sizeof(pthread_mutex_t)); + sizeof(pthread_mutex_t)); for (int i = 0; i < CRYPTO_num_locks(); i++) pthread_mutex_init(&lockarray[i], NULL); CRYPTO_set_id_callback((unsigned long (*)()) thread_id); - CRYPTO_set_locking_callback((void (*)()) lock_callback); + CRYPTO_set_locking_callback(&lock_callback); } static void destroy_ssl_locks(void) @@ -123,7 +124,25 @@ } /* - * Adds a new packet to a pool. + * Upper bound on the memory held by each packet pool. Without it a gateway + * that sends faster than pppd reads (or a gateway that stops reading) makes + * the queue, and openfortivpn's memory, grow without limit. This bounds the + * backlog, not the throughput: the memory is only used while the consumer + * lags, and at 10 Gbit/s it absorbs a stall of over 50 ms. + */ +#define PKT_POOL_MAX_BYTES (64 * 1024 * 1024) + +/* + * What a queued packet costs, counting the allocation and not only the data, + * so that a flood of tiny packets is bounded too. + */ +static inline size_t pool_packet_cost(const struct ppp_packet *packet) +{ + return sizeof(*packet) + 6 + packet->len; +} + +/* + * Adds a new packet to a pool, or frees it if the pool is full. * * Warning: for performance reasons, this function does not check if the packet * is already present in the list. If it is, there will be a loop in the list @@ -131,26 +150,54 @@ * * Warning: Once a packet is added with pool_push, consider it to be freed from * your perspective! You don't know when it will be really released by the - * thread which pool_pop it in parallel. + * thread which pool_pop it in parallel, and it is freed at once if the pool + * is full. */ -static void pool_push(struct ppp_packet_pool *pool, struct ppp_packet *new) +static void pool_push(struct ppp_packet_pool *pool, struct ppp_packet *new, + const char *name) { - struct ppp_packet *current; + size_t cost = pool_packet_cost(new); + size_t limit; + int dropped = 0, first_drop = 0, resumed = 0; pthread_mutex_lock(&pool->mutex); - new->next = NULL; - current = pool->list_head; - if (current == NULL) { - pool->list_head = new; + /* + * Once dropping, keep dropping until half the queue has drained, so + * that a queue sitting at its limit does not log twice per packet. + */ + limit = pool->dropping ? PKT_POOL_MAX_BYTES / 2 : PKT_POOL_MAX_BYTES; + if (pool->queued_bytes + cost > limit) { + /* + * The consumer is not keeping up. Dropping is safe for PPP + * (the protocols it carries recover from loss) and, unlike + * blocking the producer, cannot deadlock the I/O threads. + */ + dropped = 1; + first_drop = !pool->dropping; + pool->dropping = 1; } else { - while (current->next != NULL) - current = current->next; - current->next = new; + new->next = NULL; + if (pool->list_tail == NULL) + pool->list_head = new; + else + pool->list_tail->next = new; + pool->list_tail = new; + pool->queued_bytes += cost; + resumed = pool->dropping; + pool->dropping = 0; + pthread_cond_signal(&pool->new_data); } - pthread_cond_signal(&pool->new_data); pthread_mutex_unlock(&pool->mutex); + + if (dropped) { + free(new); + if (first_drop) + log_warn("%s queue is full, dropping packets.\n", name); + } else if (resumed) { + log_warn("%s queue has drained, accepting packets again.\n", name); + } } /* @@ -167,7 +214,10 @@ first = pool->list_head; pool->list_head = first->next; + if (pool->list_head == NULL) + pool->list_tail = NULL; first->next = NULL; + pool->queued_bytes -= pool_packet_cost(first); pthread_mutex_unlock(&pool->mutex); @@ -269,7 +319,7 @@ #else log_packet("ppp: ", packet->len, pkt_data(packet)); #endif - pool_push(&tunnel->pty_to_ssl_pool, packet); + pool_push(&tunnel->pty_to_ssl_pool, packet, "pppd-to-gateway"); off_r += frm_len; } @@ -401,9 +451,6 @@ } } -#define printable_char(c) \ - (c == '\t' || c == '\n' || (c >= ' ' && c <= '~')) - static void debug_bad_packet(struct tunnel *tunnel, uint8_t *header) { uint8_t buffer[256]; @@ -420,11 +467,17 @@ // Print hex dump do_log_packet(" (hex) ", size, buffer); - // then print the raw string, after escaping non-displayable chars + // then print the raw string, after escaping non-displayable chars. + // This goes to stdout with printf("%s"), which a front end reads line by + // line, so a gateway must not be able to inject line breaks (or tabs) and + // forge whole status lines of its own. for (int i = 0; i < size; i++) if (!printable_char((char) buffer[i])) buffer[i] = '.'; - buffer[size] = buffer[256 - 1] = '\0'; + // safe_ssl_read() can fill the whole buffer (6 header bytes + up to + // sizeof(buffer) - 6 read bytes == sizeof(buffer)), so buffer[size] can be + // one past the end. + buffer[MIN(size, sizeof(buffer) - 1)] = '\0'; printf(" (raw) %s\n", (const char *) buffer); } @@ -520,7 +573,7 @@ } } - pool_push(&tunnel->ssl_to_pty_pool, packet); + pool_push(&tunnel->ssl_to_pty_pool, packet, "gateway-to-pppd"); } // Send message to main thread to stop other threads diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openfortivpn-1.24.1/src/io.h new/openfortivpn-1.24.2/src/io.h --- old/openfortivpn-1.24.1/src/io.h 2026-01-11 13:11:14.000000000 +0100 +++ new/openfortivpn-1.24.2/src/io.h 2026-11-27 10:35:10.000000000 +0100 @@ -42,6 +42,9 @@ pthread_mutex_t mutex; pthread_cond_t new_data; struct ppp_packet *list_head; + struct ppp_packet *list_tail; + size_t queued_bytes; // memory held by the queued packets + int dropping; // set while packets are being dropped }; #define init_ppp_packet_pool(pool) \ @@ -49,6 +52,9 @@ pthread_mutex_init(&(pool)->mutex, NULL); \ pthread_cond_init(&(pool)->new_data, NULL); \ (pool)->list_head = NULL; \ + (pool)->list_tail = NULL; \ + (pool)->queued_bytes = 0; \ + (pool)->dropping = 0; \ } while (0) #define destroy_ppp_packet_pool(pool) \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openfortivpn-1.24.1/src/log.h new/openfortivpn-1.24.2/src/log.h --- old/openfortivpn-1.24.1/src/log.h 2026-01-11 13:11:14.000000000 +0100 +++ new/openfortivpn-1.24.2/src/log.h 2026-11-27 10:35:10.000000000 +0100 @@ -69,4 +69,12 @@ void do_log_packet(const char *prefix, size_t len, const uint8_t *packet); +/* + * Printable ASCII only: no tabs or line breaks. Text from the gateway that is + * printed as-is must not be able to start a line of its own, because front + * ends read openfortivpn's output line by line. + */ +#define printable_char(c) \ + ((c) >= ' ' && (c) <= '~') + #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openfortivpn-1.24.1/src/main.c new/openfortivpn-1.24.2/src/main.c --- old/openfortivpn-1.24.1/src/main.c 2026-01-11 13:11:14.000000000 +0100 +++ new/openfortivpn-1.24.2/src/main.c 2026-11-27 10:35:10.000000000 +0100 @@ -668,7 +668,7 @@ log_debug("Loaded configuration file \"%s\".\n", config_file); else log_warn("Could not load configuration file \"%s\" (%s).\n", - config_file, err_cfg_str(ret)); + config_file, strerror(-ret)); } if (cli_cfg.password_set) { if (cli_cfg.password[0] == '\0') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/openfortivpn-1.24.1/src/xml.c new/openfortivpn-1.24.2/src/xml.c --- old/openfortivpn-1.24.1/src/xml.c 2026-01-11 13:11:14.000000000 +0100 +++ new/openfortivpn-1.24.2/src/xml.c 2026-11-27 10:35:10.000000000 +0100 @@ -81,6 +81,13 @@ for (i = 1; buf[i]; i++) { if (buf[i] == quote) break; + // Values are IP addresses and a DNS domain, so ASCII. They end up + // in log lines, in resolv.conf and in route commands; none of them + // may bring its own line breaks. + if (!printable_char(buf[i])) { + log_warn("Unexpected character in a value in config XML\n"); + return NULL; + } if (i == MAX_DOMAIN_LENGTH) { log_warn("Value too long in config XML\n"); break;
