[Freeciv-Dev] [bug #24328] A number of text buffers have insufficient size

2016-02-05 Thread Marko Lindqvist
Update of bug #24328 (project freeciv):

 Open/Closed:Open => Closed 


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24328] A number of text buffers have insufficient size

2016-02-03 Thread Marko Lindqvist
Update of bug #24328 (project freeciv):

 Open/Closed:  Closed => Open   

___

Follow-up Comment #13:

To be cherry-picked to a new release branch.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24328] A number of text buffers have insufficient size

2016-02-03 Thread Marko Lindqvist
Follow-up Comment #14, bug #24328 (project freeciv):

Combined patch to cherry-pick to release branch

(file #26583)
___

Additional Item Attachment:

File name: 0005_Buffers.patch Size:2 KB


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24328] A number of text buffers have insufficient size

2016-01-23 Thread Marko Lindqvist
Update of bug #24328 (project freeciv):

  Status:  Ready For Test => Fixed  
 Open/Closed:Open => Closed 


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24328] A number of text buffers have insufficient size

2016-01-20 Thread Konstantin Vedeneev
Follow-up Comment #7, bug #24328 (project freeciv):

Two more buffers from city list:

1. strlen(Q_("?city_state:Peace"))=22
2. _("J.S. Bach's Cathedral"), " (1234/5678) ", _("(worklist)")
oversizes 128 bits.


--- client/cityrepdata.c(revision 31516)
+++ client/cityrepdata.c(working copy)
@@ -102,7 +102,7 @@
 static const char *cr_entry_hstate_verbose(const struct city *pcity,
   const void *data)
 {
-  static char buf[16];
+  static char buf[32];
   fc_snprintf(buf, sizeof(buf), "%s",
   (city_celebrating(pcity) ? Q_("?city_state:Celebrating")
: (city_unhappy(pcity) ? Q_("?city_state:Disorder")
@@ -517,7 +517,7 @@
 static const char *cr_entry_building(const struct city *pcity,
 const void *data)
 {
-  static char buf[128];
+  static char buf[192];
   const char *from_worklist =
 worklist_is_empty(>worklist) ? "" :
 gui_options.concise_city_production ? "+" : _("(worklist)");



___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24328] A number of text buffers have insufficient size

2016-01-20 Thread Marko Lindqvist
Update of bug #24328 (project freeciv):

  Status:  Ready For Test => Fixed  
 Open/Closed:Open => Closed 

___

Follow-up Comment #6:

> So, please leave this bug opened — I'll attach issues found after more
deep tests.

Current patch has been applied, and there's no issues known at the moment. I
consider ticket resolved, and not to be listed in open tickets / blocking
things.
If something new comes up either reopen this or create a new ticket
(recommended especially if something containing already committed part of this
ticket is already released)

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24328] A number of text buffers have insufficient size

2016-01-20 Thread Konstantin Vedeneev
Follow-up Comment #9, bug #24328 (project freeciv):

Yes, I can. Sorry, didn't it earlier.



(file #26403)
___

Additional Item Attachment:

File name: CityReportBuffers.patchSize:0 KB


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24328] A number of text buffers have insufficient size

2016-01-20 Thread Marko Lindqvist
Update of bug #24328 (project freeciv):

  Status:   Fixed => Ready For Test 
 Open/Closed:  Closed => Open   

___

Follow-up Comment #8:

Could you add your patches as attachment files in the future?

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24328] A number of text buffers have insufficient size

2016-01-18 Thread Konstantin Vedeneev
Follow-up Comment #2, bug #24328 (project freeciv):

Marko, thank you for the fast reply.

Test passed, file #26379 just summarize patches I've already tested on 2.5 and
2.6 (@svn).

With the current state of translations the bug is specific only to the Russian
locale, so there're no urgent need to postpone 2.5.2 release again.

I know Jacob hurry to issue release to push it into debian sid to have
ubuntu's net pulled Freeciv 2.5.2 before their package frozing. So there're no
need of brokenly patching 2.5 branch.

But 2.6 (and trunk too) have to be patched before first beta will be issued.

As I said in pps., there're can be buffers with insufficient size not related
to the bitwise settings. AFAIR, there was similar issue with city state in the
cities table, but I've just shortened the translation.

So, please leave this bug opened — I'll attach issues found after more deep
tests.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24328] A number of text buffers have insufficient size

2016-01-18 Thread Marko Lindqvist
Update of bug #24328 (project freeciv):

Severity:   2 - Minor => 3 - Normal 
  Status:None => In Progress
 Assigned to:None => cazfi  
 Planned Release: => 2.5.3, 2.6.0, 3.0.0


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #24328] A number of text buffers have insufficient size

2016-01-18 Thread Konstantin Vedeneev
URL:
  

 Summary: A number of text buffers have insufficient size
 Project: Freeciv
Submitted by: konved
Submitted on: Пн 18 янв 2016 21:27:11
Category: general
Severity: 2 - Minor
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 2.5.x, 2.6, 3.0
 Discussion Lock: Any
Operating System: Any
 Planned Release: 

___

Details:

The issue is related to the Russian i18n, but would be actual for other
languages with non-latin script (for ex: Hebrew, Arabic, Bulgarian, Ukrainian,
etc.), of course if their translators suddenly appear :).


23:35 konved@lark: ~/freeciv25 $ ./freeciv-server
Encodings: Data=UTF-8, Local=UTF-8, Internal=UTF-8
Это сервер игры Freeciv версии 2.5.1+ (modified r31484)
[...]
> set airliftingstyle FROM_ALLIES|TO_ALLIES|SRC_UNLIMITED|DEST_UNLIMITED
Invalid string conversion from UTF-8 to UTF-8: Неверный или
неполный мультибайтный или широкий
символ.
Консоль: значение параметра 'airliftingstyle' было
изменено на "Переброска по воздуху из
союзных �, "Переброска по воздуху в
союзные г�, "Неограниченное число из
пункта от и "Неограниченное число в пункт
н�.
> show airliftingstyle 
--
В столбце '##' показана возможность
изменения значения параметра:
 — знак '!' означает, что изменение
параметра заблокировано набором правил.
 — знак '+' означает, что Вы можете изменить
значение параметра.
 — знак '=' означает, что параметр
установлен в значение по умолчанию.
--
Параметр  ## значение (мин, макс)
--
airliftingstyle   +  "Переброска по воздуху
Invalid string conversion from UTF-8 to UTF-8: Неверный или
неполный мультибайтный или широкий
символ.
 из союзных �,
 "Переброска по воздуху
Invalid string conversion from UTF-8 to UTF-8: Неверный или
неполный мультибайтный или широкий
символ.
 в союзные г�,
 "Неограниченное число
 из пункта от и
 "Неограниченное число
 в пункт назн

(FROM_ALLIES|TO_ALLIES|SRC_UNLIMITED|DEST_UNLIMITED)
--
Справка по каждому параметру доступна при
помощи команды 'help <параметр>'.
--
>

You can see that some lines are incorrectly cut.

Reference: Russian error text "Неверный или неполный
мультибайтный или широкий символ." came from
libc's i18n and means "Invalid or incomplete multibyte or wide character".

Reference 2: With Russian locale the nowadays string Q_("Allows units to be
airlifted from allied cities") have only 32 characters but is 75 (!) bytes
long in UTF-8 encoding (as strlen() reports).

The 'revealmap' setting have the same issue (/set revealmap DEAD).

Okay, let's start patching from setting_bitwise_to_str():

--- server/settings.c   (revision 31484)
+++ server/settings.c   (working copy)
@@ -3234,7 +3234,7 @@
   int bit;
 
   if (pretty) {
-char buf2[64];
+char buf2[128];


And we can see (I've dropped head of table):

> set airliftingstyle FROM_ALLIES|TO_ALLIES|SRC_UNLIMITED|DEST_UNLIMITED
Консоль: значение параметра 'airliftingstyle' было
изменено на "Переброска по воздуху из
союзных городов", "Переброска по воздуху в
союзные города", "Неограниченное число из
пункта отправления" и "Неогран.
> show airliftingstyle 
--
airliftingstyle   +  "Переброска по воздуху
 из союзных городов",
 "Переброска по воздуху
 в союзные города",
 "Неограниченное число
 из пункта отправления"
 и "Неограниченное
 число в пункт
 назначения"
 [](FROM_ALLIE|
--


Well, parts of and-list are no longer truncated but the entire list doesn't
fit into another buffer now.

_[some gdb poking skipped]_

Catched show_settings_one(). Patching...

--- server/console.h(revision 31484)
+++ server/console.h(working copy)
@@ -15,7 +15,7 @@
 
 #include "support.h"/* bool type and fc__attribute */
 
-#define MAX_LEN_CONSOLE_LINE 512

[Freeciv-Dev] [bug #24328] A number of text buffers have insufficient size

2016-01-18 Thread Marko Lindqvist
Update of bug #24328 (project freeciv):

  Status: In Progress => Ready For Test 

___

Follow-up Comment #1:

Fix

Since these are not regressions since 2.5.1 I would not postpone 2.5.2 release
any more for this. However, if release does not happen in 48 hours for other
reasons, I'm still about to commit this without then waiting until the
release. This is important, but low-risk, enough to get in that way.

(file #26379)
___

Additional Item Attachment:

File name: RussianBuffers.patch   Size:1 KB


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev