Skip to content

Commit

Permalink
Merge pull request #654 from jjnicola/fix-for-clang
Browse files Browse the repository at this point in the history
Fix issues discovered with clang compiler
  • Loading branch information
bjoernricks authored Feb 11, 2021
2 parents 0044172 + dcdec4d commit 77dc00b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
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

0 comments on commit 77dc00b

Please sign in to comment.