[issue6608] asctime does not check its input

2010-10-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed with minor changes in r85137. Thanks for the patch! -- resolution: -> accepted stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker

[issue6608] asctime does not check its input

2010-09-30 Thread MunSic JEONG
MunSic JEONG added the comment: belopolsky I am little worried about my words. I made patch against 2.7-maint branch. But I recognized that patch is not following rules, because of your guidance. Then I uploaded another patch against py3k branch again. and issue6608-p3k.patch could be appli

[issue6608] asctime does not check its input

2010-09-24 Thread MunSic JEONG
MunSic JEONG added the comment: I uploaded a patch against py3k branch. Sorry for many "Added file" and "Removed file" mails. I am learning customs Trac now. -- Added file: http://bugs.python.org/file19004/issue6608-p3k.patch ___ Python tracker

[issue6608] asctime does not check its input

2010-09-24 Thread MunSic JEONG
Changes by MunSic JEONG : Removed file: http://bugs.python.org/file18987/issue6608-timemodule-2nd.patch ___ Python tracker ___ ___ Python-bugs-

[issue6608] asctime does not check its input

2010-09-24 Thread MunSic JEONG
Changes by MunSic JEONG : Removed file: http://bugs.python.org/file18978/issue6608-testcase.patch ___ Python tracker ___ ___ Python-bugs-list m

[issue6608] asctime does not check its input

2010-09-24 Thread MunSic JEONG
Changes by MunSic JEONG : Removed file: http://bugs.python.org/file18976/issue6608-timemodule.patch ___ Python tracker ___ ___ Python-bugs-list

[issue6608] asctime does not check its input

2010-09-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: No, it looks like the starting patch is against 2.7. We need a py3k patch. Meanwhile, I've noticed a couple of grammatical mistakes in comments: "strftime(), asctime() does not" -> "strftime() and asctime() do not" "fixes bug #897625, #6608" -> "fixes

[issue6608] asctime does not check its input

2010-09-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Hmm, it looks like issue6608-timemodule-2nd.patch is a patch on top of your previous patches. I'll check if I can apply last three patches in order. -- ___ Python tracker _

[issue6608] asctime does not check its input

2010-09-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: MunSic, Your patch does not apply cleanly to the py3k branch. Please not that new features can only go to py3k. While some may argue that this issue is a bug, I think it is more likely that it will only be accepted for 3.2. In any case, a py3k patch

[issue6608] asctime does not check its input

2010-09-23 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue6608] asctime does not check its input

2010-09-23 Thread MunSic JEONG
MunSic JEONG added the comment: Thank you for a kind guidance. I uploaded patch with - function name "checktm" - add comment above gettmarg - move comment in "checktm" to (above function signature) - change comment little bit to mention issue6608 - "{" on new line -- Added fil

[issue6608] asctime does not check its input

2010-09-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The patch looks good to me. Just a few nitpicks: the local convention seems to be no underscores in helper functions such as gettmarg. I would call is_valid_tm, "checktm" instead. Also, predicate-like naming (is_...) suggests a function without side-

[issue6608] asctime does not check its input

2010-09-23 Thread MunSic JEONG
Changes by MunSic JEONG : Added file: http://bugs.python.org/file18978/issue6608-testcase.patch ___ Python tracker ___ ___ Python-bugs-list mai

[issue6608] asctime does not check its input

2010-09-23 Thread MunSic JEONG
Changes by MunSic JEONG : Removed file: http://bugs.python.org/file18977/issue6608-timemodule.patch ___ Python tracker ___ ___ Python-bugs-list

[issue6608] asctime does not check its input

2010-09-23 Thread MunSic JEONG
Changes by MunSic JEONG : Added file: http://bugs.python.org/file18977/issue6608-timemodule.patch ___ Python tracker ___ ___ Python-bugs-list m

[issue6608] asctime does not check its input

2010-09-23 Thread MunSic JEONG
MunSic JEONG added the comment: As alexandre.vassalotti pointed in msg107596, I added precondition check. * extracted the range check from time_strftime as "is_valid_tm". * time_asctime, time_strftime call "is_valid_tm" * testcase for both asctime and strftime (abbeyj's work) I splited pat

[issue6608] asctime does not check its input

2010-06-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I've just noticed that time_strftime already has the range checks for tm structure fields. These checks can be separated in a function and shared with asctime. Marking this as "easy". See also issue897625. -- keywords: +easy -patch _

[issue6608] asctime does not check its input

2010-06-11 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue6608] asctime does not check its input

2010-06-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: That's what CERT recommends. Their code can be reused as is: int validate_tm(struct tm* time) { /* * The range of valid values of the tm_sec member is [0, 60] * inclusive (to allow for leap seconds). */ if (time->tm_sec < 0 || time->tm_sec

[issue6608] asctime does not check its input

2010-06-11 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: How about checking the preconditions before calling asctime()? If the check fails, then we can raise an exception without crashing. -- ___ Python tracker ___

[issue6608] asctime does not check its input

2010-06-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Hmm... it's still a crash, though. I really think this should be fixed. Crashing on invalid input is bad. -- type: behavior -> crash ___ Python tracker ___

[issue6608] asctime does not check its input

2010-06-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Downgrading further. If anyone has interest in supplying a patch, please step in. Otherwise I plan to add a note to documentation and leave the code as is. -- priority: critical -> low title: asctime causing python to crash -> asctime does not