1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

8 Commits

Author SHA1 Message Date
Jeremy Allison
70025b4a70 s3: net: Harden srprs_str() against memcmp overread.
Found by Michael Hanselmann using fuzzing tools

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13842

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-05-15 21:26:12 +00:00
Volker Lendecke
7daf5e6276 lib: Fix prototype of srprs_str
Many callers use "-1" as the "len" argument. That's what ssize_t is for.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-07-24 20:36:50 +02:00
Volker Lendecke
a845e96147 lib: Remove an #include "includes.h"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-07-24 20:36:49 +02:00
Volker Lendecke
b81990095f lib: Align integer types
Loop-variable and bound should be the same type

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2018-06-19 08:59:11 +02:00
Stefan Metzmacher
da0ee7d866 s3:lib: fix/simplify srprs_hex()
There're a few problems with this function.

- it pretends to support values up to UINT64_MAX
  in it only returns 'unsigned' which support only
  values up to UINT32_MAX. Currently we only have
  callers with len=2 and len=8, so it's not a triggered
  bug.

  We just allow (len >= 1 && len <= 8) now.

- The compiler is not able to inspect the format string
  to sscanf().

  We copy up to 8 bytes into a stack buffer
  and always pass "%8x" to sscanf.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-25 07:25:44 +01:00
Gregor Beck
0f284beb67 s3:lib: use includes.h with cbuf and srprs
hopefully fixes build on hpux

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-09-07 23:39:45 +02:00
Gregor Beck
8fc8c88007 s3: add function srprs_quoted to parse strings written with cbuf_print_quoted 2011-04-04 15:57:36 +02:00
Gregor Beck
f760494228 s3-lib: add srprs, primitives to build simple recursive parsers
Signed-off-by: Michael Adam <obnox@samba.org>
2010-09-22 06:29:59 +02:00