]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fail if SIT data is too large
authorMark Andrews <marka@isc.org>
Wed, 11 Jun 2014 21:57:19 +0000 (07:57 +1000)
committerMark Andrews <marka@isc.org>
Wed, 11 Jun 2014 21:57:19 +0000 (07:57 +1000)
bin/dig/dig.c

index 46775d8e37db64961979b23c1d4f328f469a60fd..ab35d923e3f0515f3b407288f04b0325fc4500b8 100644 (file)
@@ -761,7 +761,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
        char *cmd, *value, *ptr, *code;
        isc_uint32_t num;
        isc_boolean_t state = ISC_TRUE;
-#ifdef DIG_SIGCHASE
+#if defined(DIG_SIGCHASE) || defined(ISC_PLATFORM_USESIT)
        size_t n;
 #endif
 
@@ -1160,8 +1160,10 @@ plus_option(char *option, isc_boolean_t is_batchfile,
                                        lookup->edns = 0;
                                lookup->sit = state;
                                if (value != NULL) {
-                                       strncpy(sitvalue, value,
-                                               sizeof(sitvalue));
+                                       n = strlcpy(sitvalue, value,
+                                                   sizeof(sitvalue));
+                                       if (n >= sizeof(sitvalue))
+                                               fatal("SIT data too large");
                                        lookup->sitvalue = sitvalue;
                                } else
                                        lookup->sitvalue = NULL;