c
static BOOL rdp_write_logon_info_v1(wStream* s, logon_info* info)
{
    // ...

    WINPR_ASSERT(info);
    if (!info->domain)
        return FALSE;

    len = strnlen(info->domain, charLen + 1);
    if (len == 0 || info->domain[len-1] != '\0') { // stricter length check
        // Handle cases where string is empty or not null-terminated within charLen+1
        return FALSE;
    }


    // ...
}

