Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue39055

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:base64.b64decode() with validate=True does not raise for a trailing \n
Type:behaviorStage:resolved
Components:Library (Lib)Versions:Python 3.9, Python 3.8, Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: miss-islington, serhiy.storchaka
Priority:normalKeywords:patch

Created on2019-12-15 17:21 byserhiy.storchaka, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 17616mergedserhiy.storchaka,2019-12-15 17:26
PR 17833mergedmiss-islington,2020-01-05 12:16
PR 17834mergedmiss-islington,2020-01-05 12:16
Messages (4)
msg358438 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2019-12-15 17:21
If validate=True is passed to base64.b64decode(), it should raise a binascii.Error if the input contains any character not from the acceptable alphabet.But it does not raise if the input ends with a single \n. It raises if the input ends with a multiple \n or with any other whitespace character. Only a single \n is accepted.This is an implementation artifact. A regular exception ending with $ is used to validate an input. But $ matches not only end of string. It matches also an empty string before the trailing \n.Similar errors are also occurred in other sites. I'll open separate issues for different cases.
msg359334 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2020-01-05 12:15
New changesetb19c0d77e6f25ea831ab608c71f15d0d9266c8c4 by Serhiy Storchaka in branch 'master':bpo-39055: Reject a trailing \n in base64.b64decode() with validate=True. (GH-17616)https://github.com/python/cpython/commit/b19c0d77e6f25ea831ab608c71f15d0d9266c8c4
msg359337 -(view)Author: miss-islington (miss-islington)Date: 2020-01-05 12:32
New changeset3bdb2d9daf3ce41b325bd508e3dd29041e85dd1f by Miss Islington (bot) in branch '3.7':bpo-39055: Reject a trailing \n in base64.b64decode() with validate=True. (GH-17616)https://github.com/python/cpython/commit/3bdb2d9daf3ce41b325bd508e3dd29041e85dd1f
msg359340 -(view)Author: miss-islington (miss-islington)Date: 2020-01-05 12:36
New changeset34aa3e71dc52c1a31336302905b9ac011a310412 by Miss Islington (bot) in branch '3.8':bpo-39055: Reject a trailing \n in base64.b64decode() with validate=True. (GH-17616)https://github.com/python/cpython/commit/34aa3e71dc52c1a31336302905b9ac011a310412
History
DateUserActionArgs
2022-04-11 14:59:24adminsetgithub: 83236
2020-01-05 13:33:45serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-01-05 12:36:51miss-islingtonsetmessages: +msg359340
2020-01-05 12:32:48miss-islingtonsetnosy: +miss-islington
messages: +msg359337
2020-01-05 12:16:08miss-islingtonsetpull_requests: +pull_request17261
2020-01-05 12:16:02miss-islingtonsetpull_requests: +pull_request17260
2020-01-05 12:15:53serhiy.storchakasetmessages: +msg359334
2019-12-15 17:26:51serhiy.storchakasetkeywords: +patch
stage: patch review
pull_requests: +pull_request17087
2019-12-15 17:21:28serhiy.storchakacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp