Bug 58672 - long email overflows short used to hold message length
Summary: long email overflows short used to hold message length
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mailx
Version: 7.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ivana Varekova
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-01-22 17:17 UTC by B Griffin
Modified: 2007-04-18 16:39 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-12-02 14:45:10 UTC
Embargoed:


Attachments (Terms of Use)

Description B Griffin 2002-01-22 17:17:53 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.2-2 i686; Nav)

Description of problem:
Very long pieces of email overflow the short used to hold the message length.
When
displaying available messages the message length will often be negative when
this
happens. Then since the message appears so "small", mailx does not use a pager
to display the message but just dumps it to the screen.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Create a mailbox with a message with a number of body lines greater than a
short.
2. Open that mailbox with mailx.
3. Try to read that message.
	

Actual Results:  Huge message gets dumped to the screen.

Expected Results:  Huge message should be displayed with a pager.

Additional info:

I've got a bunch of mods now to mailx, so diff gives me a lot of output. (I am
also using a mailx from an earlier version of RedHat, but I did just verify that
this still exists in my new RH7.1 install.) I believe this patch will completely
fix
the problem:

--- mailx-8.1.1/def.h   Fri Jun 14 01:26:58 1996
+++ mailx-8.1.1-mine/def.h      Wed Mar  1 11:57:51 2000
@@ -71,10 +71,14 @@

 struct message {
        short   m_flag;                 /* flags, see below */
-       short   m_block;                /* block number of this message */
-       short   m_offset;               /* offset in block of message */
+       /* block, offset and lines should not be shorts (as they were
+       ** in the past) since those are too easy to overflow with large
+       ** mail messages.
+       **/
+       long    m_block;                /* block number of this message */
+       long    m_offset;               /* offset in block of message */
        long    m_size;                 /* Bytes in the message */
-       short   m_lines;                /* Lines in the message */
+       long    m_lines;                /* Lines in the message */
 };

Comment 1 Need Real Name 2003-12-31 07:00:38 UTC
This bug is also in version 9.

Comment 2 Ivana Varekova 2004-11-15 12:44:53 UTC
Thank you for your notice.
The problem was fixed.
IV

Comment 3 Ivana Varekova 2004-12-02 14:45:10 UTC
Solved with -40.


Note You need to log in before you can comment on or make changes to this bug.