[Forensics-changes] [yara] 145/415: Ensure terminating null is copied for TEXT_STRING (fix for r160)

Hilko Bengen bengen at moszumanska.debian.org
Thu Apr 3 05:42:56 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch debian
in repository yara.

commit bb2d27fe7b00a387f63ec7ccdaca49ec679faa91
Author: Shane Huntley <shuntley at google.com>
Date:   Fri Nov 16 19:46:30 2012 +0000

    Ensure terminating null is copied for TEXT_STRING (fix for r160)
---
 libyara/lex.c | 11 ++++++-----
 libyara/lex.l |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/libyara/lex.c b/libyara/lex.c
index 19c7612..aa04bc2 100644
--- a/libyara/lex.c
+++ b/libyara/lex.c
@@ -1,5 +1,6 @@
+#line 2 "lex.c"
 
-#line 3 "lex.c"
+#line 4 "lex.c"
 
 #define  YY_INT_ALIGNED short int
 
@@ -699,7 +700,7 @@ POSSIBILITY OF SUCH DAMAGE.
 
 
 
-#line 703 "lex.c"
+#line 704 "lex.c"
 
 #define INITIAL 0
 #define str 1
@@ -943,7 +944,7 @@ YY_DECL
 #line 88 "lex.l"
 
 
-#line 947 "lex.c"
+#line 948 "lex.c"
 
     yylval = yylval_param;
 
@@ -1505,7 +1506,7 @@ YY_RULE_SETUP
 
                                          s->length = yyextra->lex_buf_len;
 
-                                         memcpy(s->c_string, yyextra->lex_buf, yyextra->lex_buf_len);
+                                         memcpy(s->c_string, yyextra->lex_buf, yyextra->lex_buf_len + 1);
 
                                          yylval->sized_string = s;
 
@@ -1677,7 +1678,7 @@ YY_RULE_SETUP
 #line 442 "lex.l"
 ECHO;
 	YY_BREAK
-#line 1681 "lex.c"
+#line 1682 "lex.c"
 
 	case YY_END_OF_BUFFER:
 		{
diff --git a/libyara/lex.l b/libyara/lex.l
index 1569e0f..ce330f7 100644
--- a/libyara/lex.l
+++ b/libyara/lex.l
@@ -330,7 +330,7 @@ $({letter}|{digit}|_)*               {
 
                                          s->length = yyextra->lex_buf_len;
 
-                                         memcpy(s->c_string, yyextra->lex_buf, yyextra->lex_buf_len);
+                                         memcpy(s->c_string, yyextra->lex_buf, yyextra->lex_buf_len + 1);
 
                                          yylval->sized_string = s;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list