After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 60932 - Bad buffer length calculation
Bad buffer length calculation
Status: RESOLVED FIXED
Product: gmc
Classification: Deprecated
Component: general
unspecified
Other IRIX
: Normal normal
: ---
Assigned To: Andrew V. Samoilov
Andrew V. Samoilov
Depends on:
Blocks:
 
 
Reported: 2001-09-22 06:11 UTC by drk
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Commited to cvs. Thank you! (1.41 KB, text/plain)
2001-10-26 10:34 UTC, Andrew V. Samoilov
Details

Description drk 2001-09-22 06:11:06 UTC
Building mc/4.5.54 for SGI IRIX 6.5, I found that key.c was
incorrectly computing when it's buffer was full, as sizeof(int)
is not 1.  Here's a fix:

--- ./src/key.c	Sat Mar  3 17:33:25 2001
+++ ../mc-4.5.54/./src/key.c	Fri Sep 21 16:25:55 2001
@@ -370,7 +370,8 @@
 }
 
 /* The maximum sequence length (32 + null terminator) */
-static int seq_buffer [33];
+#define SEQ_BUFFER_LEN	33
+static int seq_buffer [SEQ_BUFFER_LEN];
 static int *seq_append = 0;
 
 static int push_char (int c)
@@ -378,7 +379,7 @@
     if (!seq_append)
 	seq_append = seq_buffer;
     
-    if (seq_append == &(seq_buffer [sizeof (seq_buffer)-2]))
+    if (seq_append == &(seq_buffer [SEQ_BUFFER_LEN - 2]))
 	return 0;
     *(seq_append++) = c;
     *seq_append = 0;
Comment 1 Andrew V. Samoilov 2001-10-26 10:34:13 UTC
Created attachment 5914 [details]
Commited to cvs. Thank you!
Comment 2 Kjartan Maraas 2002-01-05 18:29:28 UTC
Should this be closed then?
Comment 3 Andrew V. Samoilov 2002-01-09 07:33:51 UTC
Yes, it may be closed, but mc with this patch is not released yet.
BTW, what person can I speak to become a person who is assigned to
gmc's bug
at bugzilla.gnome.org?
Comment 4 Kjartan Maraas 2002-01-14 20:53:34 UTC
Me. I'll add you.