strncmp might be wrong used in insert-sys-cert.c

From: Chen Jingwen
Date: Fri Mar 11 2022 - 02:23:50 EST


Hi, All.

When I scanned scripts/insert-sys-cert.c, I encounter that

> strncmp(cert_sym.content, cert, cert_size) == 0) {
> warn("Certificate was already inserted.\n");
> exit(EXIT_SUCCESS);

strncmp will stop if it sees b'\0'. I think should use memcmp here.
For example, we have two _different_ certificates,
one was already inserted and another one is being processed by insert-sys-cert.
In case both certificates start with the same and follow a '\0',
another new one won't be overridden, which is not expected, right?

Chen Jingwen