diff --git a/src/ntru_file.c b/src/ntru_file.c index e2c26fd..a491659 100644 --- a/src/ntru_file.c +++ b/src/ntru_file.c @@ -108,6 +108,9 @@ write_file(string const *wstring, char const * const filename) { FILE *fp; + if (!wstring || !filename) + return false; + fp = fopen(filename, "w"); if (!fp) {