Skip to content

bpo-34471: _datetime: Add missing NULL check to tzinfo_from_isoformat… #8869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 24, 2018

Conversation

izbyshev
Copy link
Contributor

@izbyshev izbyshev commented Aug 23, 2018

…_results()

Reported by Svace static analyzer.

https://bugs.python.org/issue34471

…_results()

Reported by Svace static analyzer.
@@ -1290,6 +1290,9 @@ tzinfo_from_isoformat_results(int rv, int tzoffset, int tz_useconds) {
}

PyObject *delta = new_delta(0, tzoffset, tz_useconds, 1);
if (delta == NULL) {
return NULL;
}
tzinfo = new_timezone(delta, NULL);
Py_XDECREF(delta);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this should be changed to straight Py_DECREF.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I missed that. Thank you!

@miss-islington
Copy link
Contributor

Thanks @izbyshev for the PR, and @benjaminp for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 24, 2018
…oformat_results. (pythonGH-8869)

Reported by Svace static analyzer.
(cherry picked from commit 4988453)

Co-authored-by: Alexey Izbyshev <[email protected]>
@bedevere-bot
Copy link

GH-8901 is a backport of this pull request to the 3.7 branch.

@miss-islington
Copy link
Contributor

Sorry, @izbyshev and @benjaminp, I could not cleanly backport this to 3.6 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 498845368ff0f6238750ab1d443e7cf4ec98ccd2 3.6

@izbyshev izbyshev deleted the bpo-34471 branch August 24, 2018 15:55
miss-islington added a commit that referenced this pull request Aug 24, 2018
…oformat_results. (GH-8869)

Reported by Svace static analyzer.
(cherry picked from commit 4988453)

Co-authored-by: Alexey Izbyshev <[email protected]>
CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull request Aug 27, 2018
* master: (104 commits)
  Fast path for exact floats in math.hypot() and math.dist() (pythonGH-8949)
  Remove AIX workaround test_subprocess (pythonGH-8939)
  bpo-34503: Fix refleak in PyErr_SetObject() (pythonGH-8934)
  closes bpo-34504: Remove the useless NULL check in PySequence_Check(). (pythonGH-8935)
  closes bpo-34501: PyType_FromSpecWithBases: Check spec->name before dereferencing it. (pythonGH-8930)
  closes bpo-34502: Remove a note about utf8_mode from sys.exit() docs. (pythonGH-8928)
  Remove unneeded PyErr_Clear() in _winapi_SetNamedPipeHandleState_impl() (pythonGH-8281)
  Fix markup in stdtypes documentation (pythonGH-8905)
  bpo-34395: Don't free allocated memory on realloc fail in load_mark() in _pickle.c. (pythonGH-8788)
  Fix upsizing of marks stack in pickle module. (pythonGH-8860)
  bpo-34171: Prevent creating Lib/trace.cover when run the trace module. (pythonGH-8841)
  closes bpo-34493: Objects/genobject.c: Add missing NULL check to compute_cr_origin() (pythonGH-8911)
  Fixed typo with asynccontextmanager code example (pythonGH-8845)
  bpo-34426: fix typo (__lltrace__ -> __ltrace__) (pythonGH-8822)
  bpo-13312: Avoid int underflow in time year. (pythonGH-8912)
  bpo-34492: Python/coreconfig.c: Fix _Py_wstrlist_copy() (pythonGH-8910)
  bpo-34448: Improve output of usable wchar_t check (pythonGH-8846)
  closes bpo-34471: _datetime: Add missing NULL check to tzinfo_from_isoformat_results. (pythonGH-8869)
  bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks (pythonGH-8864)
  Fix typo in the dataclasses's doc (pythonGH-8896)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants