opnsense-src/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 Import smbfs-1.4.1. 2001-12-14 11:06:03 +00:00
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 Do not use casts as lvalues. 2004-07-28 05:33:58 +00:00
kiconv.c - Fix checking range of strings of struct iconv_add_in in libsmb and libkiconv, 2005-08-24 12:38:26 +00:00
Makefile Import smbfs-1.4.1. 2001-12-14 11:06:03 +00:00
mbuf.c Remove macros 2005-09-19 08:07:18 +00:00
nb.c Allow user to override default port numbers used by communication 2005-10-02 08:32:49 +00:00
nb_name.c Avoid unaligned memory accesses when encoding netbios names in libsmb. 2015-12-21 17:17:00 +00:00
nb_net.c Allow user to override default port numbers used by communication 2005-10-02 08:32:49 +00:00
nbns_rq.c Allow user to override default port numbers used by communication 2005-10-02 08:32:49 +00:00
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 Remove macros 2005-09-19 08:07:18 +00:00
rcfile.c + Get prototypes for libc functions. 2004-10-19 17:44:31 +00:00
rcfile_priv.h Import smbfs-1.4.1. 2001-12-14 11:06:03 +00:00
rq.c Remove the const qualifier from iconv(3) to comply with POSIX: 2015-04-15 09:09:20 +00:00
subr.c Import smbfs-1.4.2. 2001-12-20 16:16:25 +00:00