lkml.org 
[lkml]   [2022]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectstrncmp might be wrong used in insert-sys-cert.c
Date
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

\
 
 \ /
  Last update: 2022-03-11 08:25    [W:0.023 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site