gj_common: Use cppcheck to catch potential errors

This commit is contained in:
Vishesh Handa
2019-10-10 13:37:36 +02:00
parent bf67c9cd06
commit 83a0da9082
3 changed files with 5 additions and 1 deletions

View File

@ -4,3 +4,4 @@ RUN apk update
RUN apk add clang libgit2-dev
RUN apk add bash make libc-dev g++ vim gdb
RUN apk add musl-dbg git
RUN apk add curl cppcheck

View File

@ -8,3 +8,6 @@ build-env: Dockerfile
shell:
docker run --rm -it -v `pwd`:/code -w /code gitjournal_lib bash
cppcheck:
cppcheck --enable=all --suppress=unusedFunction common.c gitjournal.c keygen.c

View File

@ -79,7 +79,7 @@ int write_rsa_public_key(RSA *pRsa, const char *file_path, const char *comment)
memcpy(pEncoding, pSshHeader, 11);
index = SshEncodeBuffer(&pEncoding[11], eLen, eBytes);
index = SshEncodeBuffer(&pEncoding[11 + index], nLen, nBytes);
SshEncodeBuffer(&pEncoding[11 + index], nLen, nBytes);
b64 = BIO_new(BIO_f_base64());
BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);