diff options
author | Christian Heimes <christian@python.org> | 2015-04-16 18:26:19 (GMT) |
---|---|---|
committer | Christian Heimes <christian@python.org> | 2015-04-16 18:26:19 (GMT) |
commit | 6297fecbd1fc534176d65a6a27c01b4667a6b417 (patch) | |
tree | 7caf9b8a36517a9dba31ef64d5e0933677d0697e /Misc | |
parent | 2b78129b3a2431d0ef80ec56aec084bf846bdef0 (diff) | |
parent | a8e3f7a884061f3d251d4aec210fd274ff5b2925 (diff) | |
download | cpython-6297fecbd1fc534176d65a6a27c01b4667a6b417.zip cpython-6297fecbd1fc534176d65a6a27c01b4667a6b417.tar.gz cpython-6297fecbd1fc534176d65a6a27c01b4667a6b417.tar.bz2 |
Merge
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/coverity_model.c | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/Misc/coverity_model.c b/Misc/coverity_model.c index 421d54d..493e7c1 100644 --- a/Misc/coverity_model.c +++ b/Misc/coverity_model.c @@ -122,7 +122,8 @@ static long r_long(RFILE *p) /* Coverity doesn't understand that fdopendir() may take ownership of fd. */ -DIR *fdopendir(int fd) { +DIR *fdopendir(int fd) +{ DIR *d; if (d) { __coverity_close__(fd); @@ -130,3 +131,58 @@ DIR *fdopendir(int fd) { return d; } +/* Modules/_datetime.c + * + * Coverity thinks that the input values for these function come from a + * tainted source PyDateTime_DATE_GET_* macros use bit shifting. + */ +static PyObject * +build_struct_time(int y, int m, int d, int hh, int mm, int ss, int dstflag) +{ + PyObject *result; + + __coverity_tainted_data_sanitize__(y); + __coverity_tainted_data_sanitize__(m); + __coverity_tainted_data_sanitize__(d); + __coverity_tainted_data_sanitize__(hh); + __coverity_tainted_data_sanitize__(mm); + __coverity_tainted_data_sanitize__(ss); + __coverity_tainted_data_sanitize__(dstflag); + + return result; +} + +static int +ymd_to_ord(int year, int month, int day) +{ + int ord = 0; + + __coverity_tainted_data_sanitize__(year); + __coverity_tainted_data_sanitize__(month); + __coverity_tainted_data_sanitize__(day); + + return ord; +} + +static int +normalize_date(int *year, int *month, int *day) +{ + __coverity_tainted_data_sanitize__(*year); + __coverity_tainted_data_sanitize__(*month); + __coverity_tainted_data_sanitize__(*day); + + return 0; +} + +static int +weekday(int year, int month, int day) +{ + int w = 0; + + __coverity_tainted_data_sanitize__(year); + __coverity_tainted_data_sanitize__(month); + __coverity_tainted_data_sanitize__(day); + + return w; +} + |