freebsd-dev/contrib/smbfs/lib/smb
Ian Lepore 69ba629255 Avoid unaligned memory accesses when encoding netbios names in libsmb.
The current code for encoding a netbios name converts each byte to a 16-bit
value and stores the result by casting a char* to u_short*, resulting in
alignment faults on strict-alignment platforms.

This change reimplements the encoding routine using only byte accesses to
memory. There is no particular reason to work with 16-bit values just
because the encoding process creates two bytes of output for every byte of
input. Working a byte at at time also avoids endian problems for big-endian
platforms.

PR:		180438
PR:		189415
Differential Revision:	https://reviews.freebsd.org/D4622
2015-12-21 17:17:00 +00:00
..
cfopt.c
ctx.c Make it possible to use empty user name ("-U ''") for mount_smbfs(8). 2014-09-08 11:01:57 +00:00
file.c
kiconv.c
Makefile
mbuf.c
nb_name.c Avoid unaligned memory accesses when encoding netbios names in libsmb. 2015-12-21 17:17:00 +00:00
nb_net.c
nb.c
nbns_rq.c
nls.c Remove the const qualifier from iconv(3) to comply with POSIX: 2015-04-15 09:09:20 +00:00
print.c Remove the const qualifier from iconv(3) to comply with POSIX: 2015-04-15 09:09:20 +00:00
rap.c
rcfile_priv.h
rcfile.c
rq.c Remove the const qualifier from iconv(3) to comply with POSIX: 2015-04-15 09:09:20 +00:00
subr.c