Skip to content

fix: null ptr dereference in DescriptorData::string_to_client_encoding#2934

Closed
kvirund wants to merge 2 commits intomasterfrom
fix/msdp-null-name-crash
Closed

fix: null ptr dereference in DescriptorData::string_to_client_encoding#2934
kvirund wants to merge 2 commits intomasterfrom
fix/msdp-null-name-crash

Conversation

@kvirund
Copy link
Copy Markdown
Collaborator

@kvirund kvirund commented Feb 25, 2026

Защитная проверка на null в string_to_client_encoding — устраняет краш, но не корневую причину. Детальный анализ причины и варианты полного исправления — в #2932.

void DescriptorData::string_to_client_encoding(const char *in_str, char *out_str) const {
    if (!in_str) {
        *out_str = '\0';
        return;
    }
    // ...
}

Добавлен регрессионный тест DescriptorEncoding.StringToClientEncoding_NullInput_DoesNotCrash.

kvirund and others added 2 commits February 25, 2026 12:30
Guard against null in_str in DescriptorData::string_to_client_encoding.
The crash occurred when GET_NAME(character) returned nullptr (corrupted
or freed character still referenced in the follower list during combat
via msdp::GroupReporter::append_char -> perform_violence).

Adds regression test descriptor.encoding.cpp to catch this crash.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previous commit corrupted Russian comments by writing the file in UTF-8
instead of KOI8-R (Edit tool bypassed the encoding conversion workflow).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bylins
Copy link
Copy Markdown
Owner

bylins commented Feb 26, 2026

Если пройтись по цепочке стека то видно, предположение не верно, упали бы гораздо раньше

@bylins bylins closed this Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants