Closed Bug 263801 Opened 20 years ago Closed 19 years ago

Hang when importing invalid address book (csv file)

Categories

(Thunderbird :: Address Book, defect)

x86
All
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird1.1

People

(Reporter: aptanner, Assigned: standard8)

References

Details

(Keywords: hang)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040614 Firefox/0.9
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040614 Firefox/0.9

Thunderbird version 0.8 (20040913):

  Attempting to import an address book csv file containing the following section...

First Name, Last Name, Nickname, E-mail Address
John, Citizen, John, johnc@somewhere.com
"Jane," Citizen, Jane, janec@somewhere.com
Jim, Citizen, Jim, jimc@somewhere.com

  ...results in a hang when processing the "Jane," line. Source file is
obviously corrupt due to the comma within the quotes being discounted, but error
should be handled gracefully.
  

Reproducible: Always
Steps to Reproduce:
1.Open import dialog (Tools|Import)
2.Select "Address Books", "Text file", file location (see details for file),
column IDs
3.Click Ok to begin import

Actual Results:  
  Import process stops when it encounters the problem line and CPU usage pegs at
100%. Cancel button works but no error message is given.

Expected Results:  
  Report an invalid source file giving details (line#) and cancel import.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I have a possible solution to this - I can stop the crash, just trying to
improve the actual import algorithm as well.
*** Bug 279966 has been marked as a duplicate of this bug. ***
Test case from duplicate bug 279966:
"Jamie,",Tester,Jamie Tester,,jamie@tester.com,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Attached patch Patch for fix.Splinter Review
This patch has two parts. Firstly check for end of file whilst reading in
lines, if we have got to the end of file before a line is recongnised complete,
then that file is invalid, so return an error.

Secondly, revise the is line complete function so that it will take account of
quotes before the first delimiter. In doing so, it appears there is no point in
keeping track of if we have passed delimiters or not, so simply keep track of
the quotes.

I've tested it on both the two cases in this bug, and on a variety of my
current address books (tab and comma) for both mailnews & tb and they seem to
work ok.
Assignee: mscott → mark
Status: NEW → ASSIGNED
Attachment #174075 - Flags: review?(bienvenu)
Just some housekeeping on flags.
Keywords: hang
OS: Windows XP → All
Version: unspecified → Trunk
Attachment #174075 - Flags: review?(bienvenu) → review+
Attachment #174075 - Flags: superreview?(mscott)
Comment on attachment 174075 [details] [diff] [review]
Patch for fix.

+	 if (isEof == PR_TRUE)

that can just be
if (isEof)
Attachment #174075 - Flags: superreview?(mscott) → superreview+
This patch fixes the nit that scott raised.
Fix checked in by timeless:
2005-02-24 08:11	timeless%mozdev.org 	mozilla/ mailnews/ import/ text/ src/
nsTextAddress.h 	1.11 	1/1
2005-02-24 08:11	timeless%mozdev.org 	mozilla/ mailnews/ import/ text/ src/
nsTextAddress.cpp 	1.43 	22/38
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird1.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: