-
Notifications
You must be signed in to change notification settings - Fork 621
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…1026) * Fix possible g_memdup() silent memory truncation. (#1024) Fix possible g_memdup() silent memory truncation. Replace g_memdup() with memcpy() in some places, since g_memdup expects an guint (unsigned int) and some functions were passing bigger memory sizes (like size_t). This avoid truncation. Replace g_memdup() with g_memdup2() where possible. For backward compatibility with system with GLib < v2.68, preprocessor directives were added to continue using g_memdup() This is only for those cases in which the caller function pass valid size. For testing run the following script with `openvas-nasl -X ../my_nasl/memcpy.nasl ` ``` $ cat ../my_nasl/memcpy.nasl a = "AAAAAAAAAAAAAAA"; display (tolower(a)); display(a); b= "bbbbbbbbbbbbbbbb"; display (toupper(b)); display(b); c = "hola mundo"; display (strstr(c, "la")); ``` (cherry picked from commit ca12c69) # Conflicts: # misc/network.c # misc/plugutils.c # nasl/nasl_cert.c # nasl/nasl_crypto.c # nasl/nasl_crypto2.c # nasl/nasl_misc_funcs.c # nasl/nasl_packet_forgery.c # nasl/nasl_packet_forgery_v6.c # nasl/nasl_scanner_glue.c # nasl/nasl_socket.c # nasl/nasl_text_utils.c # nasl/nasl_var.c * Fix conflicts Co-authored-by: Juan José Nicola <jjnicola@gmail.com> Co-authored-by: Juan Jose Nicola <juan.nicola@greenbone.net>
- Loading branch information
1 parent
f64afcb
commit b9fda14
Showing
13 changed files
with
71 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters