Ticket #44421

Qt: Too small buffer for human count field in server list

Open Date: 2022-04-19 11:38 Last Update: 2022-05-02 09:02

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
1

Details

Valgrind about Qt-client in S3_0, with Russian locale:

==3200447== Conditional jump or move depends on uninitialised value(s)
==3200447== at 0x4845818: strlen (vg_replace_strmem.c:494)
==3200447== by 0x2DF7CE: QString (qstring.h:836)
==3200447== by 0x2DF7CE: fc_client::update_server_list(server_scan_type, server_list const*) (pages.cpp:929)
==3200447== by 0x2DFB37: check_server_scan (pages.cpp:1039)
==3200447== by 0x2DFB37: fc_client::check_server_scan(server_scan*) (pages.cpp:1020)

I assume this means that 'strncpy(buf, _("Unknown"), sizeof(buf) - 1);' has not NULL-terminated the string, for it being too long to fit in to the buf. That '-1' seems like the intention was to always add the terminator there, but the code doesn't do that.

Ticket History (3/4 Histories)

2022-04-19 11:38 Updated by: cazfi
  • New Ticket "Qt: Too small buffer for human count field in server list" created
2022-04-21 02:39 Updated by: cazfi
  • Owner Update from (None) to cazfi
  • Resolution Update from None to Accepted
Comment

Should be applied also to S2_6

2022-05-02 09:02 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Edit

Please login to add comment to this ticket » Login