mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-23 16:01:42 +00:00
Fix build with GCC.
BIO_new_mem_buf takes a void* buf, but internally it never modifies the buf. It assigns the buffer to another pointer and then marks it as read-only. So deconsting it should be safe here. Also fix warning about 'buf' possibly being unused in parse_cert() Approved by: bapt MFC after: 2 days X-MFC-With: r257147
This commit is contained in:
parent
b5c192462c
commit
c2788c07bf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=257193
@ -487,7 +487,7 @@ load_public_key_buf(const unsigned char *cert, int certlen)
|
||||
BIO *bp;
|
||||
char errbuf[1024];
|
||||
|
||||
bp = BIO_new_mem_buf((void *)cert, certlen);
|
||||
bp = BIO_new_mem_buf(__DECONST(void *, cert), certlen);
|
||||
|
||||
if ((pkey = PEM_read_bio_PUBKEY(bp, NULL, NULL, NULL)) == NULL)
|
||||
warnx("%s", ERR_error_string(ERR_get_error(), errbuf));
|
||||
@ -573,6 +573,7 @@ parse_cert(int fd) {
|
||||
size_t linecap;
|
||||
ssize_t linelen;
|
||||
|
||||
buf = NULL;
|
||||
my_fd = -1;
|
||||
sc = NULL;
|
||||
line = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user