Date: Sat, 26 Oct 2013 19:59:42 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257193 - head/usr.sbin/pkg Message-ID: <201310261959.r9QJxgRp011437@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery (ports committer) Date: Sat Oct 26 19:59:42 2013 New Revision: 257193 URL: http://svnweb.freebsd.org/changeset/base/257193 Log: 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 Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sat Oct 26 19:54:28 2013 (r257192) +++ head/usr.sbin/pkg/pkg.c Sat Oct 26 19:59:42 2013 (r257193) @@ -487,7 +487,7 @@ load_public_key_buf(const unsigned char 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310261959.r9QJxgRp011437>