crypto: user - fix info leaks in report API
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / crypto / pcompress.c
index 04e083ff5373528ae4cb19263cb340461827df16..7140fe70c7af04b2f544839b734de9aa5c461533 100644 (file)
@@ -53,8 +53,7 @@ static int crypto_pcomp_report(struct sk_buff *skb, struct crypto_alg *alg)
 {
        struct crypto_report_comp rpcomp;
 
-       snprintf(rpcomp.type, CRYPTO_MAX_ALG_NAME, "%s", "pcomp");
-
+       strncpy(rpcomp.type, "pcomp", sizeof(rpcomp.type));
        if (nla_put(skb, CRYPTOCFGA_REPORT_COMPRESS,
                    sizeof(struct crypto_report_comp), &rpcomp))
                goto nla_put_failure;