1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

librpc:ndr: Don’t try to log always‐NULL string

Commit c51795c747198f9e002505ffa39ad710beff0358 reorganized
ndr_pull_string() so that when we reach this DEBUG(), we don’t yet have
a string to log — ‘as’ will always be NULL. Attempting to log a NULL
string invokes undefined behaviour.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2023-11-17 10:45:29 +13:00 committed by Andrew Bartlett
parent 34d80fc96f
commit 30dd348823

View File

@ -96,7 +96,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, ndr_flags_type
"Bad string lengths len1=%"PRIu32" ofs=%"PRIu32" len2=%"PRIu32"\n",
len1, ofs, len2);
} else if (len1 != len2) {
DEBUG(6,("len1[%"PRIu32"] != len2[%"PRIu32"] '%s'\n", len1, len2, as));
DEBUG(6,("len1[%"PRIu32"] != len2[%"PRIu32"]\n", len1, len2));
}
conv_src_len = len2 + c_len_term;
break;