[issue6608] asctime does not check its input

2010-10-01 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net 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 rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-09-30 Thread MunSic JEONG

MunSic JEONG rus...@gmail.com 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 applied to py3k branch cleanly. If there were any boldness in my 
words, I'm sorry.

and I'm ready to address any thing left in this issue. :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-09-24 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net 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 should be the starting point.  Could you post a patch agains the 
py3k branch?

--
stage: needs patch - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-09-24 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net 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 rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-09-24 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net 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 bugs #897625 and #6608

--
stage: patch review - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-09-24 Thread MunSic JEONG

Changes by MunSic JEONG rus...@gmail.com:


Removed file: http://bugs.python.org/file18976/issue6608-timemodule.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-09-24 Thread MunSic JEONG

Changes by MunSic JEONG rus...@gmail.com:


Removed file: http://bugs.python.org/file18978/issue6608-testcase.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-09-24 Thread MunSic JEONG

Changes by MunSic JEONG rus...@gmail.com:


Removed file: http://bugs.python.org/file18987/issue6608-timemodule-2nd.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-09-24 Thread MunSic JEONG

MunSic JEONG rus...@gmail.com 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 rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-09-23 Thread MunSic JEONG

MunSic JEONG rus...@gmail.com 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 patch just for unittest files(Lib/test/test_time.py) and 
(Modules/timemodule.c)

--
keywords: +patch
nosy: +ruseel
Added file: http://bugs.python.org/file18976/issue6608-timemodule.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-09-23 Thread MunSic JEONG

Changes by MunSic JEONG rus...@gmail.com:


Added file: http://bugs.python.org/file18977/issue6608-timemodule.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-09-23 Thread MunSic JEONG

Changes by MunSic JEONG rus...@gmail.com:


Removed file: http://bugs.python.org/file18977/issue6608-timemodule.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-09-23 Thread MunSic JEONG

Changes by MunSic JEONG rus...@gmail.com:


Added file: http://bugs.python.org/file18978/issue6608-testcase.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-09-23 Thread MunSic JEONG

MunSic JEONG rus...@gmail.com 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 file: http://bugs.python.org/file18987/issue6608-timemodule-2nd.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-09-23 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
nosy:  -brett.cannon

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-06-24 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net 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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-06-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net 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 check its input
type: crash - behavior
versions:  -Python 2.6, Python 2.7, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-06-11 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr 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 rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-06-11 Thread Alexandre Vassalotti

Alexandre Vassalotti alexan...@peadrop.com 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 rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-06-11 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net 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  60) return 0;
  if (time-tm_min  0 || time-tm_min = 60) return 0;
  if (time-tm_hour  0 || time-tm_hour = 24) return 0;
  if (time-tm_mday = 0 || time-tm_mday  31) return 0;
  if (time-tm_mon  0 || time-tm_mon = 12) return 0;
  /* While other years are legit, they may overflow asctime()'s buffer */
  if (time-tm_year  -999 || time-tm_year  ) return 0;
  if (time-tm_wday  0 || time-tm_wday = 7) return 0;
  if (time-tm_yday  0 || time-tm_yday = 366) return 0;
  return 1;
}

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6608] asctime does not check its input

2010-06-11 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6608
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com