summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2019-08-17 18:18:54 +0200
committerMichael Brown2019-08-17 18:18:54 +0200
commita5c41483d226a6c4dbfaf35f57dc092cd57bc601 (patch)
treec55a6457992551b782db9cb0c298ba4d798214ce
parent[crypto] Profile the various stages of modular multiplication (diff)
downloadipxe-a5c41483d226a6c4dbfaf35f57dc092cd57bc601.tar.gz
ipxe-a5c41483d226a6c4dbfaf35f57dc092cd57bc601.tar.xz
ipxe-a5c41483d226a6c4dbfaf35f57dc092cd57bc601.zip
[coverity] Override assumptions about wcrtomb() and hmac_init()
Newer versions of Coverity use built-in models for wcrtomb() and hmac_init() that are capable of returning errors, and reports defects due to code failing to check for these errors. The actual iPXE implementations are simpler than Coverity's models and can never return errors, so these defects are false positives. Fix by overriding Coverity's built-in models for these functions. Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--contrib/coverity/model.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/coverity/model.c b/contrib/coverity/model.c
index 15535d42..43bac58d 100644
--- a/contrib/coverity/model.c
+++ b/contrib/coverity/model.c
@@ -7,6 +7,9 @@ typedef long off_t;
typedef void * userptr_t;
typedef long long time_t;
struct tm;
+typedef unsigned short wchar_t;
+typedef void mbstate_t;
+struct digest_algorithm;
/* Inhibit use of built-in models for functions where Coverity's
* assumptions about the modelled function are incorrect for iPXE.
@@ -19,3 +22,8 @@ time_t mktime ( struct tm *tm ) {
}
int getchar ( void ) {
}
+size_t wcrtomb ( char *buf, wchar_t wc, mbstate_t *ps ) {
+}
+void hmac_init ( struct digest_algorithm *digest, void *digest_ctx,
+ void *key, size_t *key_len ) {
+}