net/kldap: fix crash because of UB
Patch submitted upstream.
PR: 261069 (cherry picked from commit acbc052765d87af0a436f10b4c5a35880eaa14d2)