Revert "drill(1): Use strdup() for known strings."
authorzrj <rimvydas.jasinskas@gmail.com>
Mon, 15 Apr 2019 08:29:10 +0000 (11:29 +0300)
committerzrj <zrj@dragonflybsd.org>
Wed, 24 Apr 2019 17:14:00 +0000 (20:14 +0300)
This reverts commit 471272f59981f2dcc1aac28b61c0a06d49388615.

Already in a new version.

contrib/ldns/drill/drill.c

index 1a4e369..574c8b9 100644 (file)
@@ -360,7 +360,9 @@ main(int argc, char *argv[])
                                                tsig_algorithm[strlen(optarg) - tsig_separator2 - 1] = '\0';
                                        } else {
                                                tsig_separator2 = strlen(optarg);
-                                               tsig_algorithm = strdup("hmac-md5.sig-alg.reg.int");
+                                               tsig_algorithm = xmalloc(26);
+                                               strncpy(tsig_algorithm, "hmac-md5.sig-alg.reg.int.", 25);
+                                               tsig_algorithm[25] = '\0';
                                        }
                                        tsig_name = xmalloc(tsig_separator + 1);
                                        tsig_data = xmalloc(tsig_separator2 - tsig_separator);