[Python-modules-commits] [python-udatetime] 01/03: Fix out-of-bounds read

Ilias Tsitsimpis iliastsi-guest at moszumanska.debian.org
Sun Aug 6 08:53:09 UTC 2017


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

iliastsi-guest pushed a commit to branch master
in repository python-udatetime.

commit a054d1bc0b7df936f11ef7c6cbcbb8a516efe4f9
Author: Ilias Tsitsimpis <iliastsi at debian.org>
Date:   Sun Aug 6 11:11:30 2017 +0300

    Fix out-of-bounds read
    
    Increase the size of the fractions buffer to 7, to include the
    terminating null byte ('\0'). Otherwise sscanf() will read past the
    buffer area with unpredictable results.
    
    Forwarded: https://github.com/freach/udatetime/pull/20
    Bug-Debian: https://bugs.debian.org/870887
---
 src/rfc3339.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rfc3339.c b/src/rfc3339.c
index 16b80ed..1ca8717 100644
--- a/src/rfc3339.c
+++ b/src/rfc3339.c
@@ -256,7 +256,7 @@ static void _parse_time(char *time_string, time_struct *t) {
     // check for fractions
     if (*tokens == '.') {
         tokens++;
-        char fractions[6] = {0};
+        char fractions[7] = {0};
 
         // Substring fractions, max 6 digits for usec
         for (unsigned int i = 0; i < 6; i++) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-udatetime.git



More information about the Python-modules-commits mailing list