Skip to content

Commit ba38df6

Browse files
committed
nsp: stop sending nullptr strings with PR_EMS_AB_PROXY_ADDRESSES
References: GXH-173 Fixes: gromox-3.0-66-g133ddb459
1 parent fbf3249 commit ba38df6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

exch/nsp/nsp_interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ static ec_error_t nsp_interface_fetch_property(const ab_tree::ab_node &node,
468468
size_t i = 1;
469469
for (const auto &a : alias_list) {
470470
temp_len = a.size() + 6;
471-
char *z = pprop->value.string_array.ppstr[i] = ndr_stack_anew<char>(NDR_STACK_OUT, temp_len);
471+
char *z = pprop->value.string_array.ppstr[i++] = ndr_stack_anew<char>(NDR_STACK_OUT, temp_len);
472472
if (z == nullptr)
473473
return ecServerOOM;
474474
snprintf(z, temp_len, "SMTP:%s", a.c_str());

lib/mapi/ext_buffer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2527,6 +2527,11 @@ pack_result EXT_PUSH::p_str_a(const STRING_ARRAY &r)
25272527
TRY(p_uint32(r.count));
25282528
for (size_t i = 0; i < r.count; ++i) {
25292529
if (m_flags & EXT_FLAG_ABK) {
2530+
/*
2531+
* Ironically, Outlook's NSP handler eventually crashes
2532+
* when it encounters a null string so idk why MS felt
2533+
* a need to allow sending nullptr.
2534+
*/
25302535
if (r.ppstr[i] == nullptr) {
25312536
TRY(p_uint8(0));
25322537
continue;

0 commit comments

Comments
 (0)