diff options
| author | Dave Hibberd <hibby@debian.org> | 2025-02-03 22:18:58 +0000 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2025-02-03 22:18:58 +0000 |
| commit | 64d58d0c5a01551f8bfc52291986d1b8d681aca5 (patch) | |
| tree | 4f846e63762be51699156e460c79be53d8045521 /bpqaxip.c | |
| parent | a5c4d344ccf55a47fd6bc91a327073915b6c281e (diff) | |
New upstream version 6.0.24.59a+repackupstream/6.0.24.59a+repack
Diffstat (limited to 'bpqaxip.c')
| -rw-r--r-- | bpqaxip.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -141,7 +141,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses #define _CRT_SECURE_NO_DEPRECATE
-#include "CHeaders.h"
+#include "cheaders.h"
#ifndef WIN32
#include <sys/socket.h>
#include <netinet/in.h>
@@ -3246,15 +3246,21 @@ VOID SaveAXIPCache(struct AXIPPORTINFO * PORT) #ifndef LINBPQ
-static BOOL GetStringValue(config_setting_t * group, char * name, char * value)
+static BOOL GetStringValue(config_setting_t * group, char * name, char * value, int maxlen)
{
- const char * str;
+ char * str;
config_setting_t *setting;
setting = config_setting_get_member (group, name);
if (setting)
{
- str = config_setting_get_string (setting);
+ str = (char *)config_setting_get_string (setting);
+
+ if (strlen(str) > maxlen)
+ {
+ Debugprintf("Suspect config record %s", str);
+ str[maxlen] = 0;
+ }
strcpy(value, str);
return TRUE;
}
@@ -3321,7 +3327,7 @@ VOID GetAXIPCache(struct AXIPPORTINFO * PORT) ptr++;
}
- if (GetStringValue(group, Key, hostaddr))
+ if (GetStringValue(group, Key, hostaddr, 64))
{
arp->destaddr.sin_addr.s_addr = inet_addr(hostaddr);
}
|
