Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues discovered with clang compiler #654

Merged
merged 1 commit into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Changed
### Fixed
- Fix issues discovered with clang compiler. [#654](https://github.com/greenbone/openvas/pull/654)
- Fix gcc-9 adn gcc-10 warnings. [#655](https://github.com/greenbone/openvas/pull/655)

### Removed
Expand Down
20 changes: 13 additions & 7 deletions nasl/nasl_crypto2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1626,9 +1626,9 @@ encrypt_stream_data (lex_ctxt *lexic, int cipher, const char *caller_func)
if (!data || datalen <= 0)
{
nasl_perror (lexic,
"Syntax: encrypt_stream_data (called from "
"Syntax: %s (called from "
"%s): Missing data argument",
caller_func);
__func__, caller_func);
return NULL;
}

Expand All @@ -1642,7 +1642,14 @@ encrypt_stream_data (lex_ctxt *lexic, int cipher, const char *caller_func)
tmp = g_memdup (data, datalen);
tmplen = datalen;
}

else
{
nasl_perror (lexic,
"Syntax: %s (called from "
"%s): invalid cipher",
__func__, caller_func);
return NULL;
}
result = g_malloc0 (resultlen);
if ((error = gcry_cipher_encrypt (hd, result, resultlen, tmp, tmplen)))
{
Expand All @@ -1663,10 +1670,9 @@ encrypt_stream_data (lex_ctxt *lexic, int cipher, const char *caller_func)
/**
* @brief Nasl function to delete a cipher item from the cipher table.
*
* @param[in] cipher The cipher algorithm. It must be the same used for the
* handler. It is used to prepare the data. Only GCRY_CIPHER_ARCFOUR is
* currently supported.
* @return Returns the encrypted data on success. Otherwise NULL.
* @param[in] cipher_id The cipher id to close
*
* @return Returns zero on success. Otherwise NULL.
*/
tree_cell *
nasl_close_stream_cipher (lex_ctxt *lexic)
Expand Down
1 change: 0 additions & 1 deletion src/openvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ int global_max_checks = 10;
*/
GSList *log_config = NULL;

static volatile int loading_stop_signal = 0;
static volatile int termination_signal = 0;
static char *global_scan_id = NULL;

Expand Down