libDtSearch: Coverity 87032
authorPeter Howkins <flibble@users.sf.net>
Mon, 2 Jul 2018 22:09:29 +0000 (23:09 +0100)
committerPeter Howkins <flibble@users.sf.net>
Mon, 2 Jul 2018 22:09:29 +0000 (23:09 +0100)
cde/lib/DtSearch/hencode.c

index 32695067df51293834dfc4b876d20d4158743a83..5b42a318b4c7b660fb7fec9e76cbeab0a1c60709 100644 (file)
@@ -138,7 +138,7 @@ void            gen_vec (char *fname_huffcode_tab)
                continue;
 
            /* current character has LITERAL CODE */
-           strcpy (temp, huff_code[LITERAL_NUM]);
+           snprintf(temp, sizeof(temp), "%s", huff_code[LITERAL_NUM]);
            *(code_length + i) = *(code_length + LITERAL_NUM) + 8;
            ch = (unsigned char) i;
            for (j = 0; j < 8; j++) {