Ticket 4500: mcdiff: segfault when display of line numbers is enabled.
commitdfe3279a365d629ba848f0265108d98d9f12348f
authorAndrew Borodin <aborodin@vmail.ru>
Sun, 27 Aug 2023 16:32:53 +0000 (27 19:32 +0300)
committerAndrew Borodin <aborodin@vmail.ru>
Tue, 5 Sep 2023 09:52:03 +0000 (5 12:52 +0300)
tree1a72c04c6e7849ecc65f0480ac757ede6fae5ca2
parent2849d5080edfacd29fa05ea4880fc51f0e7c3d39
Ticket 4500: mcdiff: segfault when display of line numbers is enabled.

The bug was introduced in 00f84fbf24b5f65381f41c5d6333182bc7921700.

  * (dview_load_options): avoid NULL dereference: don't caclulate the
    width of line numbers field here because dview->a isn't created yet.
  * (dview_update): caclulate the width of line numbers field using an
    actual length of diff lines array.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
src/diffviewer/ydiff.c