Ticket #1835 (closed enhancement: fixed)

Opened 15 years ago

Last modified 15 years ago

Bug in get_codepage_index function.

Reported by: ASM Owned by: slavazanko
Priority: trivial Milestone: 4.7.0
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master

Description

Hello!

I find bug, file charsets.c, function get_codepage_index.

Construction:

 for (i = 0; codepages[i].id; ++i)

need:

 for (i = 0; i < n_codepages; i++)

because codepages[n_codepages] don't NULL!

Attachments

get_codepage_index.patch (388 bytes) - added by ASM 15 years ago.
Patch

Change History

Changed 15 years ago by ASM

Patch

comment:1 Changed 15 years ago by andrew_b

  • Status changed from new to closed
  • Resolution set to invalid

Everything is correct. codepages is filled by zeros initially.

codepages = g_new0 (struct codepage_desc, n_codepages + 1);

comment:2 Changed 15 years ago by andrew_b

  • Version 4.7.0-pre4 deleted
  • Milestone 4.7 deleted

comment:3 Changed 15 years ago by slavazanko

  • Status changed from closed to reopened
  • Resolution invalid deleted
  • Priority changed from major to trivial
  • Version set to master
  • Milestone set to 4.7.0
  • Type changed from defect to enhancement

As for me, this good patch for one-style coding (even if no any bugs found :)

comment:4 Changed 15 years ago by slavazanko

  • Status changed from reopened to accepted
  • Owner set to slavazanko

comment:5 Changed 15 years ago by slavazanko

  • severity changed from no branch to on review

Created branch 1835_fix_logic_in_get_codepage_index

Initial changeset:b067fd9896e6c1b922d8d02ade98ec35e2046cf0

Review.

comment:6 Changed 15 years ago by andrew_b

  • Votes for changeset set to andrew_b

comment:7 Changed 15 years ago by slavazanko

  • Votes for changeset changed from andrew_b to andrew_b slavazanko
  • severity changed from on review to approved

comment:8 Changed 15 years ago by slavazanko

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b slavazanko to commited-master
  • Resolution set to fixed
  • severity changed from approved to merged

comment:9 Changed 15 years ago by slavazanko

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.