GNOME Bugzilla – Bug 60932
Bad buffer length calculation
Last modified: 2004-12-22 21:47:04 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;
Created attachment 5914 [details] Commited to cvs. Thank you!
Should this be closed then?
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?
Me. I'll add you.