idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
1,800 | set_control_persist_exit_time(void)
{
if (muxserver_sock == -1 || !options.control_persist
|| options.control_persist_timeout == 0) {
/* not using a ControlPersist timeout */
control_persist_exit_time = 0;
} else if (channel_still_open()) {
/* some client connections are still open */
if (control_persist... | Bypass | 0 | set_control_persist_exit_time(void)
{
if (muxserver_sock == -1 || !options.control_persist
|| options.control_persist_timeout == 0) {
/* not using a ControlPersist timeout */
control_persist_exit_time = 0;
} else if (channel_still_open()) {
/* some client connections are still open */
if (control_persist... | @@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.273 2015/05/04 06:10:48 djm Exp $ */
+/* $OpenBSD: clientloop.c,v 1.274 2015/07/01 02:26:31 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -163,7 +163,7 @@ static int connection_in; /* Connecti... | CWE-264 | null | null |
1,801 | signal_handler(int sig)
{
received_signal = sig;
quit_pending = 1;
}
| Bypass | 0 | signal_handler(int sig)
{
received_signal = sig;
quit_pending = 1;
}
| @@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.273 2015/05/04 06:10:48 djm Exp $ */
+/* $OpenBSD: clientloop.c,v 1.274 2015/07/01 02:26:31 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -163,7 +163,7 @@ static int connection_in; /* Connecti... | CWE-264 | null | null |
1,802 | const char *charset_name(struct smb_iconv_handle *ic, charset_t ch)
{
switch (ch) {
case CH_UTF16: return "UTF-16LE";
case CH_UNIX: return ic->unix_charset;
case CH_DOS: return ic->dos_charset;
case CH_UTF8: return "UTF8";
case CH_UTF16BE: return "UTF-16BE";
case CH_UTF16MUNGED: return "UTF16_MUNGED";
default:
... | +Info | 0 | const char *charset_name(struct smb_iconv_handle *ic, charset_t ch)
{
switch (ch) {
case CH_UTF16: return "UTF-16LE";
case CH_UNIX: return ic->unix_charset;
case CH_DOS: return ic->dos_charset;
case CH_UTF8: return "UTF8";
case CH_UTF16BE: return "UTF-16BE";
case CH_UTF16MUNGED: return "UTF16_MUNGED";
default:
... | @@ -16669,7 +16669,10 @@ _PUBLIC_ codepoint_t next_codepoint_handle_ext(
size_t olen;
char *outbuf;
- if ((str[0] & 0x80) == 0) {
+
+ if (((str[0] & 0x80) == 0) && (src_charset == CH_DOS ||
+ src_charset == CH_UNIX ||
+ ... | CWE-200 | null | null |
1,803 | _PUBLIC_ int codepoint_cmpi(codepoint_t c1, codepoint_t c2)
{
if (c1 == c2 ||
toupper_m(c1) == toupper_m(c2)) {
return 0;
}
return c1 - c2;
}
| +Info | 0 | _PUBLIC_ int codepoint_cmpi(codepoint_t c1, codepoint_t c2)
{
if (c1 == c2 ||
toupper_m(c1) == toupper_m(c2)) {
return 0;
}
return c1 - c2;
}
| @@ -16669,7 +16669,10 @@ _PUBLIC_ codepoint_t next_codepoint_handle_ext(
size_t olen;
char *outbuf;
- if ((str[0] & 0x80) == 0) {
+
+ if (((str[0] & 0x80) == 0) && (src_charset == CH_DOS ||
+ src_charset == CH_UNIX ||
+ ... | CWE-200 | null | null |
1,804 | struct smb_iconv_handle *get_iconv_handle(void)
{
if (global_iconv_handle == NULL)
global_iconv_handle = smb_iconv_handle_reinit(talloc_autofree_context(),
"ASCII", "UTF-8", true, NULL);
return global_iconv_handle;
}
| +Info | 0 | struct smb_iconv_handle *get_iconv_handle(void)
{
if (global_iconv_handle == NULL)
global_iconv_handle = smb_iconv_handle_reinit(talloc_autofree_context(),
"ASCII", "UTF-8", true, NULL);
return global_iconv_handle;
}
| @@ -16669,7 +16669,10 @@ _PUBLIC_ codepoint_t next_codepoint_handle_ext(
size_t olen;
char *outbuf;
- if ((str[0] & 0x80) == 0) {
+
+ if (((str[0] & 0x80) == 0) && (src_charset == CH_DOS ||
+ src_charset == CH_UNIX ||
+ ... | CWE-200 | null | null |
1,805 | _PUBLIC_ bool islower_m(codepoint_t val)
{
return (toupper_m(val) != val);
}
| +Info | 0 | _PUBLIC_ bool islower_m(codepoint_t val)
{
return (toupper_m(val) != val);
}
| @@ -16669,7 +16669,10 @@ _PUBLIC_ codepoint_t next_codepoint_handle_ext(
size_t olen;
char *outbuf;
- if ((str[0] & 0x80) == 0) {
+
+ if (((str[0] & 0x80) == 0) && (src_charset == CH_DOS ||
+ src_charset == CH_UNIX ||
+ ... | CWE-200 | null | null |
1,806 | _PUBLIC_ bool isupper_m(codepoint_t val)
{
return (tolower_m(val) != val);
}
| +Info | 0 | _PUBLIC_ bool isupper_m(codepoint_t val)
{
return (tolower_m(val) != val);
}
| @@ -16669,7 +16669,10 @@ _PUBLIC_ codepoint_t next_codepoint_handle_ext(
size_t olen;
char *outbuf;
- if ((str[0] & 0x80) == 0) {
+
+ if (((str[0] & 0x80) == 0) && (src_charset == CH_DOS ||
+ src_charset == CH_UNIX ||
+ ... | CWE-200 | null | null |
1,807 | _PUBLIC_ codepoint_t next_codepoint(const char *str, size_t *size)
{
return next_codepoint_handle(get_iconv_handle(), str, size);
}
| +Info | 0 | _PUBLIC_ codepoint_t next_codepoint(const char *str, size_t *size)
{
return next_codepoint_handle(get_iconv_handle(), str, size);
}
| @@ -16669,7 +16669,10 @@ _PUBLIC_ codepoint_t next_codepoint_handle_ext(
size_t olen;
char *outbuf;
- if ((str[0] & 0x80) == 0) {
+
+ if (((str[0] & 0x80) == 0) && (src_charset == CH_DOS ||
+ src_charset == CH_UNIX ||
+ ... | CWE-200 | null | null |
1,808 | _PUBLIC_ codepoint_t next_codepoint_ext(const char *str, size_t len,
charset_t src_charset, size_t *size)
{
return next_codepoint_handle_ext(get_iconv_handle(), str, len,
src_charset, size);
}
| +Info | 0 | _PUBLIC_ codepoint_t next_codepoint_ext(const char *str, size_t len,
charset_t src_charset, size_t *size)
{
return next_codepoint_handle_ext(get_iconv_handle(), str, len,
src_charset, size);
}
| @@ -16669,7 +16669,10 @@ _PUBLIC_ codepoint_t next_codepoint_handle_ext(
size_t olen;
char *outbuf;
- if ((str[0] & 0x80) == 0) {
+
+ if (((str[0] & 0x80) == 0) && (src_charset == CH_DOS ||
+ src_charset == CH_UNIX ||
+ ... | CWE-200 | null | null |
1,809 | _PUBLIC_ codepoint_t next_codepoint_handle(struct smb_iconv_handle *ic,
const char *str, size_t *size)
{
/*
* We assume that no multi-byte character can take more than 5 bytes
* thus avoiding walking all the way down a long string. This is OK as
* Unicode codepoints only go up to (U+10ffff), which can al... | +Info | 0 | _PUBLIC_ codepoint_t next_codepoint_handle(struct smb_iconv_handle *ic,
const char *str, size_t *size)
{
/*
* We assume that no multi-byte character can take more than 5 bytes
* thus avoiding walking all the way down a long string. This is OK as
* Unicode codepoints only go up to (U+10ffff), which can al... | @@ -16669,7 +16669,10 @@ _PUBLIC_ codepoint_t next_codepoint_handle_ext(
size_t olen;
char *outbuf;
- if ((str[0] & 0x80) == 0) {
+
+ if (((str[0] & 0x80) == 0) && (src_charset == CH_DOS ||
+ src_charset == CH_UNIX ||
+ ... | CWE-200 | null | null |
1,810 | _PUBLIC_ ssize_t push_codepoint_handle(struct smb_iconv_handle *ic,
char *str, codepoint_t c)
{
smb_iconv_t descriptor;
uint8_t buf[4];
size_t ilen, olen;
const char *inbuf;
if (c < 128) {
*str = c;
return 1;
}
descriptor = get_conv_handle(ic,
CH_UTF16, CH_UNIX);
if (descriptor == (smb_iconv_... | +Info | 0 | _PUBLIC_ ssize_t push_codepoint_handle(struct smb_iconv_handle *ic,
char *str, codepoint_t c)
{
smb_iconv_t descriptor;
uint8_t buf[4];
size_t ilen, olen;
const char *inbuf;
if (c < 128) {
*str = c;
return 1;
}
descriptor = get_conv_handle(ic,
CH_UTF16, CH_UNIX);
if (descriptor == (smb_iconv_... | @@ -16669,7 +16669,10 @@ _PUBLIC_ codepoint_t next_codepoint_handle_ext(
size_t olen;
char *outbuf;
- if ((str[0] & 0x80) == 0) {
+
+ if (((str[0] & 0x80) == 0) && (src_charset == CH_DOS ||
+ src_charset == CH_UNIX ||
+ ... | CWE-200 | null | null |
1,811 | _PUBLIC_ struct smb_iconv_handle *smb_iconv_handle_reinit(TALLOC_CTX *mem_ctx,
const char *dos_charset,
const char *unix_charset,
bool use_builtin_handlers,
struct smb_iconv_handle *old_ic)
{
struct smb_iconv_handle *ret;
if (old_ic != NULL) {
ret = old_ic;
close_i... | +Info | 0 | _PUBLIC_ struct smb_iconv_handle *smb_iconv_handle_reinit(TALLOC_CTX *mem_ctx,
const char *dos_charset,
const char *unix_charset,
bool use_builtin_handlers,
struct smb_iconv_handle *old_ic)
{
struct smb_iconv_handle *ret;
if (old_ic != NULL) {
ret = old_ic;
close_i... | @@ -16669,7 +16669,10 @@ _PUBLIC_ codepoint_t next_codepoint_handle_ext(
size_t olen;
char *outbuf;
- if ((str[0] & 0x80) == 0) {
+
+ if (((str[0] & 0x80) == 0) && (src_charset == CH_DOS ||
+ src_charset == CH_UNIX ||
+ ... | CWE-200 | null | null |
1,812 | void smb_init_locale(void)
{
/* This is a useful global hook where we can ensure that the
* locale is set from the environment. This is needed so that
* we can use LOCALE as a codepage */
#ifdef HAVE_SETLOCALE
setlocale(LC_ALL, "");
#endif
}
| +Info | 0 | void smb_init_locale(void)
{
/* This is a useful global hook where we can ensure that the
* locale is set from the environment. This is needed so that
* we can use LOCALE as a codepage */
#ifdef HAVE_SETLOCALE
setlocale(LC_ALL, "");
#endif
}
| @@ -16669,7 +16669,10 @@ _PUBLIC_ codepoint_t next_codepoint_handle_ext(
size_t olen;
char *outbuf;
- if ((str[0] & 0x80) == 0) {
+
+ if (((str[0] & 0x80) == 0) && (src_charset == CH_DOS ||
+ src_charset == CH_UNIX ||
+ ... | CWE-200 | null | null |
1,813 | _PUBLIC_ codepoint_t tolower_m(codepoint_t val)
{
if (val < 128) {
return tolower(val);
}
if (val >= ARRAY_SIZE(lowcase_table)) {
return val;
}
return lowcase_table[val];
}
| +Info | 0 | _PUBLIC_ codepoint_t tolower_m(codepoint_t val)
{
if (val < 128) {
return tolower(val);
}
if (val >= ARRAY_SIZE(lowcase_table)) {
return val;
}
return lowcase_table[val];
}
| @@ -16669,7 +16669,10 @@ _PUBLIC_ codepoint_t next_codepoint_handle_ext(
size_t olen;
char *outbuf;
- if ((str[0] & 0x80) == 0) {
+
+ if (((str[0] & 0x80) == 0) && (src_charset == CH_DOS ||
+ src_charset == CH_UNIX ||
+ ... | CWE-200 | null | null |
1,814 | _PUBLIC_ codepoint_t toupper_m(codepoint_t val)
{
if (val < 128) {
return toupper(val);
}
if (val >= ARRAY_SIZE(upcase_table)) {
return val;
}
return upcase_table[val];
}
| +Info | 0 | _PUBLIC_ codepoint_t toupper_m(codepoint_t val)
{
if (val < 128) {
return toupper(val);
}
if (val >= ARRAY_SIZE(upcase_table)) {
return val;
}
return upcase_table[val];
}
| @@ -16669,7 +16669,10 @@ _PUBLIC_ codepoint_t next_codepoint_handle_ext(
size_t olen;
char *outbuf;
- if ((str[0] & 0x80) == 0) {
+
+ if (((str[0] & 0x80) == 0) && (src_charset == CH_DOS ||
+ src_charset == CH_UNIX ||
+ ... | CWE-200 | null | null |
1,815 | static void ldb_dn_mark_invalid(struct ldb_dn *dn)
{
dn->invalid = true;
}
| +Info | 0 | static void ldb_dn_mark_invalid(struct ldb_dn *dn)
{
dn->invalid = true;
}
| @@ -189,33 +189,23 @@ struct ldb_dn *ldb_dn_new_fmt(TALLOC_CTX *mem_ctx,
/* see RFC2253 section 2.4 */
static int ldb_dn_escape_internal(char *dst, const char *src, int len)
{
- const char *p, *s;
+ char c;
char *d;
- size_t l;
-
- p = s = src;
+ int i;
d = dst;
- ... | CWE-200 | null | null |
1,816 | struct ldb_dn *ldb_dn_new(TALLOC_CTX *mem_ctx,
struct ldb_context *ldb,
const char *strdn)
{
struct ldb_val blob;
blob.data = discard_const_p(uint8_t, strdn);
blob.length = strdn ? strlen(strdn) : 0;
return ldb_dn_from_ldb_val(mem_ctx, ldb, &blob);
}
| +Info | 0 | struct ldb_dn *ldb_dn_new(TALLOC_CTX *mem_ctx,
struct ldb_context *ldb,
const char *strdn)
{
struct ldb_val blob;
blob.data = discard_const_p(uint8_t, strdn);
blob.length = strdn ? strlen(strdn) : 0;
return ldb_dn_from_ldb_val(mem_ctx, ldb, &blob);
}
| @@ -189,33 +189,23 @@ struct ldb_dn *ldb_dn_new_fmt(TALLOC_CTX *mem_ctx,
/* see RFC2253 section 2.4 */
static int ldb_dn_escape_internal(char *dst, const char *src, int len)
{
- const char *p, *s;
+ char c;
char *d;
- size_t l;
-
- p = s = src;
+ int i;
d = dst;
- ... | CWE-200 | null | null |
1,817 | struct ldb_dn *ldb_dn_new_fmt(TALLOC_CTX *mem_ctx,
struct ldb_context *ldb,
const char *new_fmt, ...)
{
char *strdn;
va_list ap;
if ( (! mem_ctx) || (! ldb)) return NULL;
va_start(ap, new_fmt);
strdn = talloc_vasprintf(mem_ctx, new_fmt, ap);
va_end(ap);
if (strdn) {
struct ldb_dn *dn = ldb... | +Info | 0 | struct ldb_dn *ldb_dn_new_fmt(TALLOC_CTX *mem_ctx,
struct ldb_context *ldb,
const char *new_fmt, ...)
{
char *strdn;
va_list ap;
if ( (! mem_ctx) || (! ldb)) return NULL;
va_start(ap, new_fmt);
strdn = talloc_vasprintf(mem_ctx, new_fmt, ap);
va_end(ap);
if (strdn) {
struct ldb_dn *dn = ldb... | @@ -189,33 +189,23 @@ struct ldb_dn *ldb_dn_new_fmt(TALLOC_CTX *mem_ctx,
/* see RFC2253 section 2.4 */
static int ldb_dn_escape_internal(char *dst, const char *src, int len)
{
- const char *p, *s;
+ char c;
char *d;
- size_t l;
-
- p = s = src;
+ int i;
d = dst;
- ... | CWE-200 | null | null |
1,818 | _PUBLIC_ size_t count_chars_m(const char *s, char c)
{
struct smb_iconv_handle *ic = get_iconv_handle();
size_t count = 0;
while (*s) {
size_t size;
codepoint_t c2 = next_codepoint_handle(ic, s, &size);
if (c2 == c) count++;
s += size;
}
return count;
}
| +Info | 0 | _PUBLIC_ size_t count_chars_m(const char *s, char c)
{
struct smb_iconv_handle *ic = get_iconv_handle();
size_t count = 0;
while (*s) {
size_t size;
codepoint_t c2 = next_codepoint_handle(ic, s, &size);
if (c2 == c) count++;
s += size;
}
return count;
}
| @@ -110,11 +110,12 @@ _PUBLIC_ char *strupper_talloc_n_handle(struct smb_iconv_handle *iconv_handle,
return NULL;
}
- while (n-- && *src) {
+ while (n && *src) {
size_t c_size;
codepoint_t c = next_codepoint_handle_ext(iconv_handle, src, n,
... | CWE-200 | null | null |
1,819 | static ssize_t pull_ascii_string(char *dest, const void *src, size_t dest_len, size_t src_len, int flags)
{
size_t size = 0;
if (flags & (STR_TERMINATE | STR_TERMINATE_ASCII)) {
if (src_len == (size_t)-1) {
src_len = strlen((const char *)src) + 1;
} else {
size_t len = strnlen((const char *)src, src_len);
... | +Info | 0 | static ssize_t pull_ascii_string(char *dest, const void *src, size_t dest_len, size_t src_len, int flags)
{
size_t size = 0;
if (flags & (STR_TERMINATE | STR_TERMINATE_ASCII)) {
if (src_len == (size_t)-1) {
src_len = strlen((const char *)src) + 1;
} else {
size_t len = strnlen((const char *)src, src_len);
... | @@ -110,11 +110,12 @@ _PUBLIC_ char *strupper_talloc_n_handle(struct smb_iconv_handle *iconv_handle,
return NULL;
}
- while (n-- && *src) {
+ while (n && *src) {
size_t c_size;
codepoint_t c = next_codepoint_handle_ext(iconv_handle, src, n,
... | CWE-200 | null | null |
1,820 | _PUBLIC_ ssize_t pull_string(char *dest, const void *src, size_t dest_len, size_t src_len, int flags)
{
if (flags & STR_ASCII) {
return pull_ascii_string(dest, src, dest_len, src_len, flags);
} else if (flags & STR_UNICODE) {
return pull_ucs2(dest, src, dest_len, src_len, flags);
} else {
smb_panic("pull_strin... | +Info | 0 | _PUBLIC_ ssize_t pull_string(char *dest, const void *src, size_t dest_len, size_t src_len, int flags)
{
if (flags & STR_ASCII) {
return pull_ascii_string(dest, src, dest_len, src_len, flags);
} else if (flags & STR_UNICODE) {
return pull_ucs2(dest, src, dest_len, src_len, flags);
} else {
smb_panic("pull_strin... | @@ -110,11 +110,12 @@ _PUBLIC_ char *strupper_talloc_n_handle(struct smb_iconv_handle *iconv_handle,
return NULL;
}
- while (n-- && *src) {
+ while (n && *src) {
size_t c_size;
codepoint_t c = next_codepoint_handle_ext(iconv_handle, src, n,
... | CWE-200 | null | null |
1,821 | static bool push_ascii_string(void *dest, const char *src, size_t dest_len, int flags, size_t *converted_size)
{
size_t src_len;
bool ret;
if (flags & STR_UPPER) {
char *tmpbuf = strupper_talloc(NULL, src);
if (tmpbuf == NULL) {
return false;
}
ret = push_ascii_string(dest, tmpbuf, dest_len, flags & ~STR... | +Info | 0 | static bool push_ascii_string(void *dest, const char *src, size_t dest_len, int flags, size_t *converted_size)
{
size_t src_len;
bool ret;
if (flags & STR_UPPER) {
char *tmpbuf = strupper_talloc(NULL, src);
if (tmpbuf == NULL) {
return false;
}
ret = push_ascii_string(dest, tmpbuf, dest_len, flags & ~STR... | @@ -110,11 +110,12 @@ _PUBLIC_ char *strupper_talloc_n_handle(struct smb_iconv_handle *iconv_handle,
return NULL;
}
- while (n-- && *src) {
+ while (n && *src) {
size_t c_size;
codepoint_t c = next_codepoint_handle_ext(iconv_handle, src, n,
... | CWE-200 | null | null |
1,822 | _PUBLIC_ ssize_t push_string(void *dest, const char *src, size_t dest_len, int flags)
{
if (flags & STR_ASCII) {
size_t size = 0;
if (push_ascii_string(dest, src, dest_len, flags, &size)) {
return (ssize_t)size;
} else {
return (ssize_t)-1;
}
} else if (flags & STR_UNICODE) {
return push_ucs2(dest, sr... | +Info | 0 | _PUBLIC_ ssize_t push_string(void *dest, const char *src, size_t dest_len, int flags)
{
if (flags & STR_ASCII) {
size_t size = 0;
if (push_ascii_string(dest, src, dest_len, flags, &size)) {
return (ssize_t)size;
} else {
return (ssize_t)-1;
}
} else if (flags & STR_UNICODE) {
return push_ucs2(dest, sr... | @@ -110,11 +110,12 @@ _PUBLIC_ char *strupper_talloc_n_handle(struct smb_iconv_handle *iconv_handle,
return NULL;
}
- while (n-- && *src) {
+ while (n && *src) {
size_t c_size;
codepoint_t c = next_codepoint_handle_ext(iconv_handle, src, n,
... | CWE-200 | null | null |
1,823 | static ssize_t push_ucs2(void *dest, const char *src, size_t dest_len, int flags)
{
size_t len=0;
size_t src_len = strlen(src);
size_t size = 0;
bool ret;
if (flags & STR_UPPER) {
char *tmpbuf = strupper_talloc(NULL, src);
ssize_t retval;
if (tmpbuf == NULL) {
return -1;
}
retval = push_ucs2(dest, tm... | +Info | 0 | static ssize_t push_ucs2(void *dest, const char *src, size_t dest_len, int flags)
{
size_t len=0;
size_t src_len = strlen(src);
size_t size = 0;
bool ret;
if (flags & STR_UPPER) {
char *tmpbuf = strupper_talloc(NULL, src);
ssize_t retval;
if (tmpbuf == NULL) {
return -1;
}
retval = push_ucs2(dest, tm... | @@ -110,11 +110,12 @@ _PUBLIC_ char *strupper_talloc_n_handle(struct smb_iconv_handle *iconv_handle,
return NULL;
}
- while (n-- && *src) {
+ while (n && *src) {
size_t c_size;
codepoint_t c = next_codepoint_handle_ext(iconv_handle, src, n,
... | CWE-200 | null | null |
1,824 | _PUBLIC_ char *strlower_talloc(TALLOC_CTX *ctx, const char *src)
{
struct smb_iconv_handle *iconv_handle = get_iconv_handle();
return strlower_talloc_handle(iconv_handle, ctx, src);
}
| +Info | 0 | _PUBLIC_ char *strlower_talloc(TALLOC_CTX *ctx, const char *src)
{
struct smb_iconv_handle *iconv_handle = get_iconv_handle();
return strlower_talloc_handle(iconv_handle, ctx, src);
}
| @@ -110,11 +110,12 @@ _PUBLIC_ char *strupper_talloc_n_handle(struct smb_iconv_handle *iconv_handle,
return NULL;
}
- while (n-- && *src) {
+ while (n && *src) {
size_t c_size;
codepoint_t c = next_codepoint_handle_ext(iconv_handle, src, n,
... | CWE-200 | null | null |
1,825 | _PUBLIC_ char *strlower_talloc_handle(struct smb_iconv_handle *iconv_handle,
TALLOC_CTX *ctx, const char *src)
{
size_t size=0;
char *dest;
if(src == NULL) {
return NULL;
}
/* this takes advantage of the fact that upper/lower can't
change the length of a character by more than 1 byte */
dest = t... | +Info | 0 | _PUBLIC_ char *strlower_talloc_handle(struct smb_iconv_handle *iconv_handle,
TALLOC_CTX *ctx, const char *src)
{
size_t size=0;
char *dest;
if(src == NULL) {
return NULL;
}
/* this takes advantage of the fact that upper/lower can't
change the length of a character by more than 1 byte */
dest = t... | @@ -110,11 +110,12 @@ _PUBLIC_ char *strupper_talloc_n_handle(struct smb_iconv_handle *iconv_handle,
return NULL;
}
- while (n-- && *src) {
+ while (n && *src) {
size_t c_size;
codepoint_t c = next_codepoint_handle_ext(iconv_handle, src, n,
... | CWE-200 | null | null |
1,826 | _PUBLIC_ char *strupper_talloc(TALLOC_CTX *ctx, const char *src)
{
return strupper_talloc_n(ctx, src, src?strlen(src):0);
}
| +Info | 0 | _PUBLIC_ char *strupper_talloc(TALLOC_CTX *ctx, const char *src)
{
return strupper_talloc_n(ctx, src, src?strlen(src):0);
}
| @@ -110,11 +110,12 @@ _PUBLIC_ char *strupper_talloc_n_handle(struct smb_iconv_handle *iconv_handle,
return NULL;
}
- while (n-- && *src) {
+ while (n && *src) {
size_t c_size;
codepoint_t c = next_codepoint_handle_ext(iconv_handle, src, n,
... | CWE-200 | null | null |
1,827 | _PUBLIC_ char *strupper_talloc_n(TALLOC_CTX *ctx, const char *src, size_t n)
{
struct smb_iconv_handle *iconv_handle = get_iconv_handle();
return strupper_talloc_n_handle(iconv_handle, ctx, src, n);
}
| +Info | 0 | _PUBLIC_ char *strupper_talloc_n(TALLOC_CTX *ctx, const char *src, size_t n)
{
struct smb_iconv_handle *iconv_handle = get_iconv_handle();
return strupper_talloc_n_handle(iconv_handle, ctx, src, n);
}
| @@ -110,11 +110,12 @@ _PUBLIC_ char *strupper_talloc_n_handle(struct smb_iconv_handle *iconv_handle,
return NULL;
}
- while (n-- && *src) {
+ while (n && *src) {
size_t c_size;
codepoint_t c = next_codepoint_handle_ext(iconv_handle, src, n,
... | CWE-200 | null | null |
1,828 | _PUBLIC_ char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *src)
{
return strupper_talloc(ctx, src);
}
| +Info | 0 | _PUBLIC_ char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *src)
{
return strupper_talloc(ctx, src);
}
| @@ -110,11 +110,12 @@ _PUBLIC_ char *strupper_talloc_n_handle(struct smb_iconv_handle *iconv_handle,
return NULL;
}
- while (n-- && *src) {
+ while (n && *src) {
size_t c_size;
codepoint_t c = next_codepoint_handle_ext(iconv_handle, src, n,
... | CWE-200 | null | null |
1,829 | _PUBLIC_ int strcasecmp_m(const char *s1, const char *s2)
{
struct smb_iconv_handle *iconv_handle = get_iconv_handle();
return strcasecmp_m_handle(iconv_handle, s1, s2);
}
| +Info | 0 | _PUBLIC_ int strcasecmp_m(const char *s1, const char *s2)
{
struct smb_iconv_handle *iconv_handle = get_iconv_handle();
return strcasecmp_m_handle(iconv_handle, s1, s2);
}
| @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,830 | _PUBLIC_ int strcasecmp_m_handle(struct smb_iconv_handle *iconv_handle,
const char *s1, const char *s2)
{
codepoint_t c1=0, c2=0;
size_t size1, size2;
/* handle null ptr comparisons to simplify the use in qsort */
if (s1 == s2) return 0;
if (s1 == NULL) return -1;
if (s2 == NULL) return 1;
while (*s1 && *... | +Info | 0 | _PUBLIC_ int strcasecmp_m_handle(struct smb_iconv_handle *iconv_handle,
const char *s1, const char *s2)
{
codepoint_t c1=0, c2=0;
size_t size1, size2;
/* handle null ptr comparisons to simplify the use in qsort */
if (s1 == s2) return 0;
if (s1 == NULL) return -1;
if (s2 == NULL) return 1;
while (*s1 && *... | @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,831 | _PUBLIC_ char *strchr_m(const char *src, char c)
{
const char *s;
struct smb_iconv_handle *ic = get_iconv_handle();
if (src == NULL) {
return NULL;
}
/* characters below 0x3F are guaranteed to not appear in
non-initial position in multi-byte charsets */
if ((c & 0xC0) == 0) {
return strchr(src, c);
}
/... | +Info | 0 | _PUBLIC_ char *strchr_m(const char *src, char c)
{
const char *s;
struct smb_iconv_handle *ic = get_iconv_handle();
if (src == NULL) {
return NULL;
}
/* characters below 0x3F are guaranteed to not appear in
non-initial position in multi-byte charsets */
if ((c & 0xC0) == 0) {
return strchr(src, c);
}
/... | @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,832 | _PUBLIC_ bool strcsequal(const char *s1,const char *s2)
{
if (s1 == s2)
return true;
if (!s1 || !s2)
return false;
return strcmp(s1,s2) == 0;
}
| +Info | 0 | _PUBLIC_ bool strcsequal(const char *s1,const char *s2)
{
if (s1 == s2)
return true;
if (!s1 || !s2)
return false;
return strcmp(s1,s2) == 0;
}
| @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,833 | _PUBLIC_ bool strequal_m(const char *s1, const char *s2)
{
return strcasecmp_m(s1,s2) == 0;
}
| +Info | 0 | _PUBLIC_ bool strequal_m(const char *s1, const char *s2)
{
return strcasecmp_m(s1,s2) == 0;
}
| @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,834 | _PUBLIC_ bool strhaslower(const char *string)
{
struct smb_iconv_handle *ic = get_iconv_handle();
return strhaslower_handle(ic, string);
}
| +Info | 0 | _PUBLIC_ bool strhaslower(const char *string)
{
struct smb_iconv_handle *ic = get_iconv_handle();
return strhaslower_handle(ic, string);
}
| @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,835 | _PUBLIC_ bool strhaslower_handle(struct smb_iconv_handle *ic,
const char *string)
{
while (*string) {
size_t c_size;
codepoint_t s;
codepoint_t t;
s = next_codepoint_handle(ic, string, &c_size);
string += c_size;
t = toupper_m(s);
if (s != t) {
return true; /* that means it has lower case char... | +Info | 0 | _PUBLIC_ bool strhaslower_handle(struct smb_iconv_handle *ic,
const char *string)
{
while (*string) {
size_t c_size;
codepoint_t s;
codepoint_t t;
s = next_codepoint_handle(ic, string, &c_size);
string += c_size;
t = toupper_m(s);
if (s != t) {
return true; /* that means it has lower case char... | @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,836 | _PUBLIC_ bool strhasupper(const char *string)
{
struct smb_iconv_handle *ic = get_iconv_handle();
return strhasupper_handle(ic, string);
}
| +Info | 0 | _PUBLIC_ bool strhasupper(const char *string)
{
struct smb_iconv_handle *ic = get_iconv_handle();
return strhasupper_handle(ic, string);
}
| @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,837 | _PUBLIC_ bool strhasupper_handle(struct smb_iconv_handle *ic,
const char *string)
{
while (*string) {
size_t c_size;
codepoint_t s;
codepoint_t t;
s = next_codepoint_handle(ic, string, &c_size);
string += c_size;
t = tolower_m(s);
if (s != t) {
return true; /* that means it has upper case char... | +Info | 0 | _PUBLIC_ bool strhasupper_handle(struct smb_iconv_handle *ic,
const char *string)
{
while (*string) {
size_t c_size;
codepoint_t s;
codepoint_t t;
s = next_codepoint_handle(ic, string, &c_size);
string += c_size;
t = tolower_m(s);
if (s != t) {
return true; /* that means it has upper case char... | @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,838 | _PUBLIC_ size_t strlen_m(const char *s)
{
return strlen_m_ext(s, CH_UNIX, CH_UTF16LE);
}
| +Info | 0 | _PUBLIC_ size_t strlen_m(const char *s)
{
return strlen_m_ext(s, CH_UNIX, CH_UTF16LE);
}
| @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,839 | _PUBLIC_ size_t strlen_m_ext(const char *s, charset_t src_charset, charset_t dst_charset)
{
struct smb_iconv_handle *ic = get_iconv_handle();
return strlen_m_ext_handle(ic, s, src_charset, dst_charset);
}
| +Info | 0 | _PUBLIC_ size_t strlen_m_ext(const char *s, charset_t src_charset, charset_t dst_charset)
{
struct smb_iconv_handle *ic = get_iconv_handle();
return strlen_m_ext_handle(ic, s, src_charset, dst_charset);
}
| @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,840 | _PUBLIC_ size_t strlen_m_ext_term(const char *s, const charset_t src_charset,
const charset_t dst_charset)
{
if (!s) {
return 0;
}
return strlen_m_ext(s, src_charset, dst_charset) + 1;
}
| +Info | 0 | _PUBLIC_ size_t strlen_m_ext_term(const char *s, const charset_t src_charset,
const charset_t dst_charset)
{
if (!s) {
return 0;
}
return strlen_m_ext(s, src_charset, dst_charset) + 1;
}
| @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,841 | _PUBLIC_ size_t strlen_m_ext_term_null(const char *s,
const charset_t src_charset,
const charset_t dst_charset)
{
size_t len;
if (!s) {
return 0;
}
len = strlen_m_ext(s, src_charset, dst_charset);
if (len == 0) {
return 0;
}
return len+1;
}
| +Info | 0 | _PUBLIC_ size_t strlen_m_ext_term_null(const char *s,
const charset_t src_charset,
const charset_t dst_charset)
{
size_t len;
if (!s) {
return 0;
}
len = strlen_m_ext(s, src_charset, dst_charset);
if (len == 0) {
return 0;
}
return len+1;
}
| @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,842 | _PUBLIC_ size_t strlen_m_term(const char *s)
{
return strlen_m_ext_term(s, CH_UNIX, CH_UTF16LE);
}
| +Info | 0 | _PUBLIC_ size_t strlen_m_term(const char *s)
{
return strlen_m_ext_term(s, CH_UNIX, CH_UTF16LE);
}
| @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,843 | _PUBLIC_ size_t strlen_m_term_null(const char *s)
{
return strlen_m_ext_term_null(s, CH_UNIX, CH_UTF16LE);
}
| +Info | 0 | _PUBLIC_ size_t strlen_m_term_null(const char *s)
{
return strlen_m_ext_term_null(s, CH_UNIX, CH_UTF16LE);
}
| @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,844 | _PUBLIC_ int strncasecmp_m(const char *s1, const char *s2, size_t n)
{
struct smb_iconv_handle *iconv_handle = get_iconv_handle();
return strncasecmp_m_handle(iconv_handle, s1, s2, n);
}
| +Info | 0 | _PUBLIC_ int strncasecmp_m(const char *s1, const char *s2, size_t n)
{
struct smb_iconv_handle *iconv_handle = get_iconv_handle();
return strncasecmp_m_handle(iconv_handle, s1, s2, n);
}
| @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,845 | _PUBLIC_ char *strrchr_m(const char *s, char c)
{
struct smb_iconv_handle *ic;
char *ret = NULL;
if (s == NULL) {
return NULL;
}
/* characters below 0x3F are guaranteed to not appear in
non-initial position in multi-byte charsets */
if ((c & 0xC0) == 0) {
return strrchr(s, c);
}
/* this is quite a co... | +Info | 0 | _PUBLIC_ char *strrchr_m(const char *s, char c)
{
struct smb_iconv_handle *ic;
char *ret = NULL;
if (s == NULL) {
return NULL;
}
/* characters below 0x3F are guaranteed to not appear in
non-initial position in multi-byte charsets */
if ((c & 0xC0) == 0) {
return strrchr(s, c);
}
/* this is quite a co... | @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,846 | char *strstr_m(const char *src, const char *findstr)
{
smb_ucs2_t *p;
smb_ucs2_t *src_w, *find_w;
const char *s;
char *s2;
char *retp;
size_t converted_size, findstr_len = 0;
TALLOC_CTX *frame; /* Only set up in the iconv case */
/* for correctness */
if (!findstr[0]) {
return discard_const_p(char, src);
... | +Info | 0 | char *strstr_m(const char *src, const char *findstr)
{
smb_ucs2_t *p;
smb_ucs2_t *src_w, *find_w;
const char *s;
char *s2;
char *retp;
size_t converted_size, findstr_len = 0;
TALLOC_CTX *frame; /* Only set up in the iconv case */
/* for correctness */
if (!findstr[0]) {
return discard_const_p(char, src);
... | @@ -210,7 +210,8 @@ _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
while (*s) {
size_t c_size;
- codepoint_t c = next_codepoint_handle_ext(ic, s, src_charset, &c_size);
+ codepoint_t c = next_codepoint_handle_ext(ic, s, strnlen(s, 5),
+ ... | CWE-200 | null | null |
1,847 | static int ldb_dn_escape_internal(char *dst, const char *src, int len)
{
char c;
char *d;
int i;
d = dst;
for (i = 0; i < len; i++){
c = src[i];
switch (c) {
case ' ':
if (i == 0 || i == len - 1) {
/* if at the beginning or end
* of the string then escape */
*d++ = '\\';
*d++ = c;
} e... | +Info | 0 | static int ldb_dn_escape_internal(char *dst, const char *src, int len)
{
char c;
char *d;
int i;
d = dst;
for (i = 0; i < len; i++){
c = src[i];
switch (c) {
case ' ':
if (i == 0 || i == len - 1) {
/* if at the beginning or end
* of the string then escape */
*d++ = '\\';
*d++ = c;
} e... | @@ -586,12 +586,15 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
p++;
*d++ = '\0';
- dn->components[dn->comp_num].value.data = (uint8_t *)talloc_strdup(dn->components, dt);
+ dn->components[d... | CWE-200 | null | null |
1,848 | bool ldb_dn_add_base(struct ldb_dn *dn, struct ldb_dn *base)
{
const char *s;
char *t;
if ( !base || base->invalid || !dn || dn->invalid) {
return false;
}
if (dn->components) {
unsigned int i;
if ( ! ldb_dn_validate(base)) {
return false;
}
s = NULL;
if (dn->valid_case) {
if ( ! (s = ldb_dn_... | +Info | 0 | bool ldb_dn_add_base(struct ldb_dn *dn, struct ldb_dn *base)
{
const char *s;
char *t;
if ( !base || base->invalid || !dn || dn->invalid) {
return false;
}
if (dn->components) {
unsigned int i;
if ( ! ldb_dn_validate(base)) {
return false;
}
s = NULL;
if (dn->valid_case) {
if ( ! (s = ldb_dn_... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,849 | bool ldb_dn_add_base_fmt(struct ldb_dn *dn, const char *base_fmt, ...)
{
struct ldb_dn *base;
char *base_str;
va_list ap;
bool ret;
if ( !dn || dn->invalid) {
return false;
}
va_start(ap, base_fmt);
base_str = talloc_vasprintf(dn, base_fmt, ap);
va_end(ap);
if (base_str == NULL) {
return false;
}
ba... | +Info | 0 | bool ldb_dn_add_base_fmt(struct ldb_dn *dn, const char *base_fmt, ...)
{
struct ldb_dn *base;
char *base_str;
va_list ap;
bool ret;
if ( !dn || dn->invalid) {
return false;
}
va_start(ap, base_fmt);
base_str = talloc_vasprintf(dn, base_fmt, ap);
va_end(ap);
if (base_str == NULL) {
return false;
}
ba... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,850 | bool ldb_dn_add_child(struct ldb_dn *dn, struct ldb_dn *child)
{
const char *s;
char *t;
if ( !child || child->invalid || !dn || dn->invalid) {
return false;
}
if (dn->components) {
unsigned int n;
unsigned int i, j;
if (dn->comp_num == 0) {
return false;
}
if ( ! ldb_dn_validate(child)) {
re... | +Info | 0 | bool ldb_dn_add_child(struct ldb_dn *dn, struct ldb_dn *child)
{
const char *s;
char *t;
if ( !child || child->invalid || !dn || dn->invalid) {
return false;
}
if (dn->components) {
unsigned int n;
unsigned int i, j;
if (dn->comp_num == 0) {
return false;
}
if ( ! ldb_dn_validate(child)) {
re... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,851 | bool ldb_dn_add_child_fmt(struct ldb_dn *dn, const char *child_fmt, ...)
{
struct ldb_dn *child;
char *child_str;
va_list ap;
bool ret;
if ( !dn || dn->invalid) {
return false;
}
va_start(ap, child_fmt);
child_str = talloc_vasprintf(dn, child_fmt, ap);
va_end(ap);
if (child_str == NULL) {
return false;... | +Info | 0 | bool ldb_dn_add_child_fmt(struct ldb_dn *dn, const char *child_fmt, ...)
{
struct ldb_dn *child;
char *child_str;
va_list ap;
bool ret;
if ( !dn || dn->invalid) {
return false;
}
va_start(ap, child_fmt);
child_str = talloc_vasprintf(dn, child_fmt, ap);
va_end(ap);
if (child_str == NULL) {
return false;... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,852 | char *ldb_dn_alloc_linearized(TALLOC_CTX *mem_ctx, struct ldb_dn *dn)
{
return talloc_strdup(mem_ctx, ldb_dn_get_linearized(dn));
}
| +Info | 0 | char *ldb_dn_alloc_linearized(TALLOC_CTX *mem_ctx, struct ldb_dn *dn)
{
return talloc_strdup(mem_ctx, ldb_dn_get_linearized(dn));
}
| @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,853 | static char *ldb_dn_canonical(TALLOC_CTX *mem_ctx, struct ldb_dn *dn, int ex_format) {
unsigned int i;
TALLOC_CTX *tmpctx;
char *cracked = NULL;
const char *format = (ex_format ? "\n" : "/" );
if ( ! ldb_dn_validate(dn)) {
return NULL;
}
tmpctx = talloc_new(mem_ctx);
/* Walk backwards down the DN, grabbing... | +Info | 0 | static char *ldb_dn_canonical(TALLOC_CTX *mem_ctx, struct ldb_dn *dn, int ex_format) {
unsigned int i;
TALLOC_CTX *tmpctx;
char *cracked = NULL;
const char *format = (ex_format ? "\n" : "/" );
if ( ! ldb_dn_validate(dn)) {
return NULL;
}
tmpctx = talloc_new(mem_ctx);
/* Walk backwards down the DN, grabbing... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,854 | char *ldb_dn_canonical_ex_string(TALLOC_CTX *mem_ctx, struct ldb_dn *dn) {
return ldb_dn_canonical(mem_ctx, dn, 1);
}
| +Info | 0 | char *ldb_dn_canonical_ex_string(TALLOC_CTX *mem_ctx, struct ldb_dn *dn) {
return ldb_dn_canonical(mem_ctx, dn, 1);
}
| @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,855 | char *ldb_dn_canonical_string(TALLOC_CTX *mem_ctx, struct ldb_dn *dn) {
return ldb_dn_canonical(mem_ctx, dn, 0);
}
| +Info | 0 | char *ldb_dn_canonical_string(TALLOC_CTX *mem_ctx, struct ldb_dn *dn) {
return ldb_dn_canonical(mem_ctx, dn, 0);
}
| @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,856 | static bool ldb_dn_casefold_internal(struct ldb_dn *dn)
{
unsigned int i;
int ret;
if ( ! dn || dn->invalid) return false;
if (dn->valid_case) return true;
if (( ! dn->components) && ( ! ldb_dn_explode(dn))) {
return false;
}
for (i = 0; i < dn->comp_num; i++) {
const struct ldb_schema_attribute *a;
d... | +Info | 0 | static bool ldb_dn_casefold_internal(struct ldb_dn *dn)
{
unsigned int i;
int ret;
if ( ! dn || dn->invalid) return false;
if (dn->valid_case) return true;
if (( ! dn->components) && ( ! ldb_dn_explode(dn))) {
return false;
}
for (i = 0; i < dn->comp_num; i++) {
const struct ldb_schema_attribute *a;
d... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,857 | bool ldb_dn_check_special(struct ldb_dn *dn, const char *check)
{
if ( ! dn || dn->invalid) return false;
return ! strcmp(dn->linearized, check);
}
| +Info | 0 | bool ldb_dn_check_special(struct ldb_dn *dn, const char *check)
{
if ( ! dn || dn->invalid) return false;
return ! strcmp(dn->linearized, check);
}
| @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,858 | int ldb_dn_compare(struct ldb_dn *dn0, struct ldb_dn *dn1)
{
unsigned int i;
int ret;
if (( ! dn0) || dn0->invalid || ! dn1 || dn1->invalid) {
return -1;
}
if (( ! dn0->valid_case) || ( ! dn1->valid_case)) {
if (dn0->linearized && dn1->linearized) {
/* try with a normal compare first, if we are lucky
... | +Info | 0 | int ldb_dn_compare(struct ldb_dn *dn0, struct ldb_dn *dn1)
{
unsigned int i;
int ret;
if (( ! dn0) || dn0->invalid || ! dn1 || dn1->invalid) {
return -1;
}
if (( ! dn0->valid_case) || ( ! dn1->valid_case)) {
if (dn0->linearized && dn1->linearized) {
/* try with a normal compare first, if we are lucky
... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,859 | int ldb_dn_compare_base(struct ldb_dn *base, struct ldb_dn *dn)
{
int ret;
unsigned int n_base, n_dn;
if ( ! base || base->invalid) return 1;
if ( ! dn || dn->invalid) return -1;
if (( ! base->valid_case) || ( ! dn->valid_case)) {
if (base->linearized && dn->linearized && dn->special == base->special) {
/* ... | +Info | 0 | int ldb_dn_compare_base(struct ldb_dn *base, struct ldb_dn *dn)
{
int ret;
unsigned int n_base, n_dn;
if ( ! base || base->invalid) return 1;
if ( ! dn || dn->invalid) return -1;
if (( ! base->valid_case) || ( ! dn->valid_case)) {
if (base->linearized && dn->linearized && dn->special == base->special) {
/* ... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,860 | static struct ldb_dn_component ldb_dn_copy_component(
TALLOC_CTX *mem_ctx,
struct ldb_dn_component *src)
{
struct ldb_dn_component dst;
memset(&dst, 0, sizeof(dst));
if (src == NULL) {
return dst;
}
dst.value = ldb_val_dup(mem_ctx, &(src->value));
if (dst.value.data == NULL) {
return dst;
}
... | +Info | 0 | static struct ldb_dn_component ldb_dn_copy_component(
TALLOC_CTX *mem_ctx,
struct ldb_dn_component *src)
{
struct ldb_dn_component dst;
memset(&dst, 0, sizeof(dst));
if (src == NULL) {
return dst;
}
dst.value = ldb_val_dup(mem_ctx, &(src->value));
if (dst.value.data == NULL) {
return dst;
}
... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,861 | static bool ldb_dn_explode(struct ldb_dn *dn)
{
char *p, *ex_name = NULL, *ex_value = NULL, *data, *d, *dt, *t;
bool trim = true;
bool in_extended = true;
bool in_ex_name = false;
bool in_ex_value = false;
bool in_attr = false;
bool in_value = false;
bool in_quote = false;
bool is_oid = false;
bool escape = f... | +Info | 0 | static bool ldb_dn_explode(struct ldb_dn *dn)
{
char *p, *ex_name = NULL, *ex_value = NULL, *data, *d, *dt, *t;
bool trim = true;
bool in_extended = true;
bool in_ex_name = false;
bool in_ex_value = false;
bool in_attr = false;
bool in_value = false;
bool in_quote = false;
bool is_oid = false;
bool escape = f... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,862 | static struct ldb_dn_ext_component ldb_dn_ext_copy_component(
TALLOC_CTX *mem_ctx,
struct ldb_dn_ext_component *src)
{
struct ldb_dn_ext_component dst;
memset(&dst, 0, sizeof(dst));
if (src == NULL) {
return dst;
}
dst.value = ldb_val_dup(mem_ctx, &(src->value));
if (dst.value.data == NULL) {
r... | +Info | 0 | static struct ldb_dn_ext_component ldb_dn_ext_copy_component(
TALLOC_CTX *mem_ctx,
struct ldb_dn_ext_component *src)
{
struct ldb_dn_ext_component dst;
memset(&dst, 0, sizeof(dst));
if (src == NULL) {
return dst;
}
dst.value = ldb_val_dup(mem_ctx, &(src->value));
if (dst.value.data == NULL) {
r... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,863 | static int ldb_dn_extended_component_compare(const void *p1, const void *p2)
{
const struct ldb_dn_ext_component *ec1 = (const struct ldb_dn_ext_component *)p1;
const struct ldb_dn_ext_component *ec2 = (const struct ldb_dn_ext_component *)p2;
return strcmp(ec1->name, ec2->name);
}
| +Info | 0 | static int ldb_dn_extended_component_compare(const void *p1, const void *p2)
{
const struct ldb_dn_ext_component *ec1 = (const struct ldb_dn_ext_component *)p1;
const struct ldb_dn_ext_component *ec2 = (const struct ldb_dn_ext_component *)p2;
return strcmp(ec1->name, ec2->name);
}
| @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,864 | void ldb_dn_extended_filter(struct ldb_dn *dn, const char * const *accept_list)
{
unsigned int i;
for (i=0; i<dn->ext_comp_num; i++) {
if (!ldb_attr_in_list(accept_list, dn->ext_components[i].name)) {
memmove(&dn->ext_components[i],
&dn->ext_components[i+1],
(dn->ext_comp_num-(i+1))*sizeof(dn->ext_compon... | +Info | 0 | void ldb_dn_extended_filter(struct ldb_dn *dn, const char * const *accept_list)
{
unsigned int i;
for (i=0; i<dn->ext_comp_num; i++) {
if (!ldb_attr_in_list(accept_list, dn->ext_components[i].name)) {
memmove(&dn->ext_components[i],
&dn->ext_components[i+1],
(dn->ext_comp_num-(i+1))*sizeof(dn->ext_compon... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,865 | const char *ldb_dn_get_casefold(struct ldb_dn *dn)
{
unsigned int i;
size_t len;
char *d, *n;
if (dn->casefold) return dn->casefold;
if (dn->special) {
dn->casefold = talloc_strdup(dn, dn->linearized);
if (!dn->casefold) return NULL;
dn->valid_case = true;
return dn->casefold;
}
if ( ! ldb_dn_casefold... | +Info | 0 | const char *ldb_dn_get_casefold(struct ldb_dn *dn)
{
unsigned int i;
size_t len;
char *d, *n;
if (dn->casefold) return dn->casefold;
if (dn->special) {
dn->casefold = talloc_strdup(dn, dn->linearized);
if (!dn->casefold) return NULL;
dn->valid_case = true;
return dn->casefold;
}
if ( ! ldb_dn_casefold... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,866 | int ldb_dn_get_comp_num(struct ldb_dn *dn)
{
if ( ! ldb_dn_validate(dn)) {
return -1;
}
return dn->comp_num;
}
| +Info | 0 | int ldb_dn_get_comp_num(struct ldb_dn *dn)
{
if ( ! ldb_dn_validate(dn)) {
return -1;
}
return dn->comp_num;
}
| @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,867 | const struct ldb_val *ldb_dn_get_component_val(struct ldb_dn *dn,
unsigned int num)
{
if ( ! ldb_dn_validate(dn)) {
return NULL;
}
if (num >= dn->comp_num) return NULL;
return &dn->components[num].value;
}
| +Info | 0 | const struct ldb_val *ldb_dn_get_component_val(struct ldb_dn *dn,
unsigned int num)
{
if ( ! ldb_dn_validate(dn)) {
return NULL;
}
if (num >= dn->comp_num) return NULL;
return &dn->components[num].value;
}
| @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,868 | int ldb_dn_get_extended_comp_num(struct ldb_dn *dn)
{
if ( ! ldb_dn_validate(dn)) {
return -1;
}
return dn->ext_comp_num;
}
| +Info | 0 | int ldb_dn_get_extended_comp_num(struct ldb_dn *dn)
{
if ( ! ldb_dn_validate(dn)) {
return -1;
}
return dn->ext_comp_num;
}
| @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,869 | const struct ldb_val *ldb_dn_get_extended_component(struct ldb_dn *dn,
const char *name)
{
unsigned int i;
if ( ! ldb_dn_validate(dn)) {
return NULL;
}
for (i=0; i < dn->ext_comp_num; i++) {
if (ldb_attr_cmp(dn->ext_components[i].name, name) == 0) {
return &dn->ext_components[i].value;
}
}
retu... | +Info | 0 | const struct ldb_val *ldb_dn_get_extended_component(struct ldb_dn *dn,
const char *name)
{
unsigned int i;
if ( ! ldb_dn_validate(dn)) {
return NULL;
}
for (i=0; i < dn->ext_comp_num; i++) {
if (ldb_attr_cmp(dn->ext_components[i].name, name) == 0) {
return &dn->ext_components[i].value;
}
}
retu... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,870 | struct ldb_dn *ldb_dn_get_parent(TALLOC_CTX *mem_ctx, struct ldb_dn *dn)
{
struct ldb_dn *new_dn;
new_dn = ldb_dn_copy(mem_ctx, dn);
if ( !new_dn ) {
return NULL;
}
if ( ! ldb_dn_remove_child_components(new_dn, 1)) {
talloc_free(new_dn);
return NULL;
}
return new_dn;
}
| +Info | 0 | struct ldb_dn *ldb_dn_get_parent(TALLOC_CTX *mem_ctx, struct ldb_dn *dn)
{
struct ldb_dn *new_dn;
new_dn = ldb_dn_copy(mem_ctx, dn);
if ( !new_dn ) {
return NULL;
}
if ( ! ldb_dn_remove_child_components(new_dn, 1)) {
talloc_free(new_dn);
return NULL;
}
return new_dn;
}
| @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,871 | const char *ldb_dn_get_rdn_name(struct ldb_dn *dn)
{
if ( ! ldb_dn_validate(dn)) {
return NULL;
}
if (dn->comp_num == 0) return NULL;
return dn->components[0].name;
}
| +Info | 0 | const char *ldb_dn_get_rdn_name(struct ldb_dn *dn)
{
if ( ! ldb_dn_validate(dn)) {
return NULL;
}
if (dn->comp_num == 0) return NULL;
return dn->components[0].name;
}
| @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,872 | bool ldb_dn_has_extended(struct ldb_dn *dn)
{
if ( ! dn || dn->invalid) return false;
if (dn->ext_linearized && (dn->ext_linearized[0] == '<')) return true;
return dn->ext_comp_num != 0;
}
| +Info | 0 | bool ldb_dn_has_extended(struct ldb_dn *dn)
{
if ( ! dn || dn->invalid) return false;
if (dn->ext_linearized && (dn->ext_linearized[0] == '<')) return true;
return dn->ext_comp_num != 0;
}
| @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,873 | bool ldb_dn_is_null(struct ldb_dn *dn)
{
if ( ! dn || dn->invalid) return false;
if (ldb_dn_has_extended(dn)) return false;
if (dn->linearized && (dn->linearized[0] == '\0')) return true;
return false;
}
| +Info | 0 | bool ldb_dn_is_null(struct ldb_dn *dn)
{
if ( ! dn || dn->invalid) return false;
if (ldb_dn_has_extended(dn)) return false;
if (dn->linearized && (dn->linearized[0] == '\0')) return true;
return false;
}
| @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,874 | bool ldb_dn_is_special(struct ldb_dn *dn)
{
if ( ! dn || dn->invalid) return false;
return dn->special;
}
| +Info | 0 | bool ldb_dn_is_special(struct ldb_dn *dn)
{
if ( ! dn || dn->invalid) return false;
return dn->special;
}
| @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,875 | bool ldb_dn_remove_child_components(struct ldb_dn *dn, unsigned int num)
{
unsigned int i, j;
if ( ! ldb_dn_validate(dn)) {
return false;
}
if (dn->comp_num < num) {
return false;
}
for (i = 0, j = num; j < dn->comp_num; i++, j++) {
if (i < num) {
LDB_FREE(dn->components[i].name);
LDB_FREE(dn->comp... | +Info | 0 | bool ldb_dn_remove_child_components(struct ldb_dn *dn, unsigned int num)
{
unsigned int i, j;
if ( ! ldb_dn_validate(dn)) {
return false;
}
if (dn->comp_num < num) {
return false;
}
for (i = 0, j = num; j < dn->comp_num; i++, j++) {
if (i < num) {
LDB_FREE(dn->components[i].name);
LDB_FREE(dn->comp... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,876 | void ldb_dn_remove_extended_components(struct ldb_dn *dn)
{
LDB_FREE(dn->ext_linearized);
LDB_FREE(dn->ext_components);
dn->ext_comp_num = 0;
}
| +Info | 0 | void ldb_dn_remove_extended_components(struct ldb_dn *dn)
{
LDB_FREE(dn->ext_linearized);
LDB_FREE(dn->ext_components);
dn->ext_comp_num = 0;
}
| @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,877 | bool ldb_dn_replace_components(struct ldb_dn *dn, struct ldb_dn *new_dn)
{
int i;
if ( ! ldb_dn_validate(dn) || ! ldb_dn_validate(new_dn)) {
return false;
}
/* free components */
for (i = 0; i < dn->comp_num; i++) {
LDB_FREE(dn->components[i].name);
LDB_FREE(dn->components[i].value.data);
LDB_FREE(dn->co... | +Info | 0 | bool ldb_dn_replace_components(struct ldb_dn *dn, struct ldb_dn *new_dn)
{
int i;
if ( ! ldb_dn_validate(dn) || ! ldb_dn_validate(new_dn)) {
return false;
}
/* free components */
for (i = 0; i < dn->comp_num; i++) {
LDB_FREE(dn->components[i].name);
LDB_FREE(dn->components[i].value.data);
LDB_FREE(dn->co... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,878 | int ldb_dn_set_component(struct ldb_dn *dn, int num,
const char *name, const struct ldb_val val)
{
char *n;
struct ldb_val v;
if ( ! ldb_dn_validate(dn)) {
return LDB_ERR_OTHER;
}
if (num >= dn->comp_num) {
return LDB_ERR_OTHER;
}
n = talloc_strdup(dn, name);
if ( ! n) {
return LDB_ERR_OTHER;
}
... | +Info | 0 | int ldb_dn_set_component(struct ldb_dn *dn, int num,
const char *name, const struct ldb_val val)
{
char *n;
struct ldb_val v;
if ( ! ldb_dn_validate(dn)) {
return LDB_ERR_OTHER;
}
if (num >= dn->comp_num) {
return LDB_ERR_OTHER;
}
n = talloc_strdup(dn, name);
if ( ! n) {
return LDB_ERR_OTHER;
}
... | @@ -250,7 +250,7 @@ static int ldb_dn_escape_internal(char *dst, const char *src, int len)
char *ldb_dn_escape_value(TALLOC_CTX *mem_ctx, struct ldb_val value)
{
char *dst;
-
+ size_t len;
if (!value.length)
return NULL;
@@ -261,10 +261,14 @@ char *ldb_dn_escape_value(TALLOC_CT... | CWE-200 | null | null |
1,879 | do_call_operator(op_proc_t op_proc, i_ctx_t *i_ctx_p)
{
int code;
code = op_proc(i_ctx_p);
if (gs_debug_c(gs_debug_flag_validate_clumps))
ivalidate_clean_spaces(i_ctx_p);
return code; /* A good place for a conditional breakpoint. */
}
| Bypass +Info | 0 | do_call_operator(op_proc_t op_proc, i_ctx_t *i_ctx_p)
{
int code;
code = op_proc(i_ctx_p);
if (gs_debug_c(gs_debug_flag_validate_clumps))
ivalidate_clean_spaces(i_ctx_p);
return code; /* A good place for a conditional breakpoint. */
}
| @@ -142,7 +142,6 @@ static int oparray_pop(i_ctx_t *);
static int oparray_cleanup(i_ctx_t *);
static int zerrorexec(i_ctx_t *);
static int zfinderrorobject(i_ctx_t *);
-static int errorexec_find(i_ctx_t *, ref *);
static int errorexec_pop(i_ctx_t *);
static int errorexec_cleanup(i_ctx_t *);
static int zsetstackpr... | CWE-200 | null | null |
1,880 | do_call_operator_verbose(op_proc_t op_proc, i_ctx_t *i_ctx_p)
{
int code;
#ifndef SHOW_STACK_DEPTHS
if_debug1m('!', imemory, "[!]operator %s\n", op_get_name_string(op_proc));
#else
if_debug3m('!', imemory, "[!][es=%d os=%d]operator %s\n",
esp-i_ctx_p->exec_stack.stack.bot,
osp-i_ctx... | Bypass +Info | 0 | do_call_operator_verbose(op_proc_t op_proc, i_ctx_t *i_ctx_p)
{
int code;
#ifndef SHOW_STACK_DEPTHS
if_debug1m('!', imemory, "[!]operator %s\n", op_get_name_string(op_proc));
#else
if_debug3m('!', imemory, "[!][es=%d os=%d]operator %s\n",
esp-i_ctx_p->exec_stack.stack.bot,
osp-i_ctx... | @@ -142,7 +142,6 @@ static int oparray_pop(i_ctx_t *);
static int oparray_cleanup(i_ctx_t *);
static int zerrorexec(i_ctx_t *);
static int zfinderrorobject(i_ctx_t *);
-static int errorexec_find(i_ctx_t *, ref *);
static int errorexec_pop(i_ctx_t *);
static int errorexec_cleanup(i_ctx_t *);
static int zsetstackpr... | CWE-200 | null | null |
1,881 | gs_interp_alloc_stacks(gs_ref_memory_t *mem, gs_context_state_t * pcst)
{
int code;
gs_ref_memory_t *smem =
(gs_ref_memory_t *)gs_memory_stable((gs_memory_t *)mem);
ref stk;
#define REFS_SIZE_OSTACK OS_REFS_SIZE(MAX_OSTACK)
#define REFS_SIZE_ESTACK ES_REFS_SIZE(MAX_ESTACK)
#define REFS_SIZE_DSTACK ... | Bypass +Info | 0 | gs_interp_alloc_stacks(gs_ref_memory_t *mem, gs_context_state_t * pcst)
{
int code;
gs_ref_memory_t *smem =
(gs_ref_memory_t *)gs_memory_stable((gs_memory_t *)mem);
ref stk;
#define REFS_SIZE_OSTACK OS_REFS_SIZE(MAX_OSTACK)
#define REFS_SIZE_ESTACK ES_REFS_SIZE(MAX_ESTACK)
#define REFS_SIZE_DSTACK ... | @@ -142,7 +142,6 @@ static int oparray_pop(i_ctx_t *);
static int oparray_cleanup(i_ctx_t *);
static int zerrorexec(i_ctx_t *);
static int zfinderrorobject(i_ctx_t *);
-static int errorexec_find(i_ctx_t *, ref *);
static int errorexec_pop(i_ctx_t *);
static int errorexec_cleanup(i_ctx_t *);
static int zsetstackpr... | CWE-200 | null | null |
1,882 | gs_interp_make_oper(ref * opref, op_proc_t proc, int idx)
{
int i;
for (i = num_special_ops; i > 0 && proc != interp1_op_defs[i].proc; --i)
DO_NOTHING;
if (i > 0)
make_tasv(opref, tx_op + (i - 1), a_executable, i, opproc, proc);
else
make_tasv(opref, t_operator, a_executable, id... | Bypass +Info | 0 | gs_interp_make_oper(ref * opref, op_proc_t proc, int idx)
{
int i;
for (i = num_special_ops; i > 0 && proc != interp1_op_defs[i].proc; --i)
DO_NOTHING;
if (i > 0)
make_tasv(opref, tx_op + (i - 1), a_executable, i, opproc, proc);
else
make_tasv(opref, t_operator, a_executable, id... | @@ -142,7 +142,6 @@ static int oparray_pop(i_ctx_t *);
static int oparray_cleanup(i_ctx_t *);
static int zerrorexec(i_ctx_t *);
static int zfinderrorobject(i_ctx_t *);
-static int errorexec_find(i_ctx_t *, ref *);
static int errorexec_pop(i_ctx_t *);
static int errorexec_cleanup(i_ctx_t *);
static int zsetstackpr... | CWE-200 | null | null |
1,883 | gs_interp_reset(i_ctx_t *i_ctx_p)
{ /* Reset the stacks. */
ref_stack_clear(&o_stack);
ref_stack_clear(&e_stack);
esp++;
make_oper(esp, 0, interp_exit);
ref_stack_pop_to(&d_stack, min_dstack_size);
dict_set_top();
}
| Bypass +Info | 0 | gs_interp_reset(i_ctx_t *i_ctx_p)
{ /* Reset the stacks. */
ref_stack_clear(&o_stack);
ref_stack_clear(&e_stack);
esp++;
make_oper(esp, 0, interp_exit);
ref_stack_pop_to(&d_stack, min_dstack_size);
dict_set_top();
}
| @@ -142,7 +142,6 @@ static int oparray_pop(i_ctx_t *);
static int oparray_cleanup(i_ctx_t *);
static int zerrorexec(i_ctx_t *);
static int zfinderrorobject(i_ctx_t *);
-static int errorexec_find(i_ctx_t *, ref *);
static int errorexec_pop(i_ctx_t *);
static int errorexec_cleanup(i_ctx_t *);
static int zsetstackpr... | CWE-200 | null | null |
1,884 | interp_exit(i_ctx_t *i_ctx_p)
{
return gs_error_InterpreterExit;
}
| Bypass +Info | 0 | interp_exit(i_ctx_t *i_ctx_p)
{
return gs_error_InterpreterExit;
}
| @@ -142,7 +142,6 @@ static int oparray_pop(i_ctx_t *);
static int oparray_cleanup(i_ctx_t *);
static int zerrorexec(i_ctx_t *);
static int zfinderrorobject(i_ctx_t *);
-static int errorexec_find(i_ctx_t *, ref *);
static int errorexec_pop(i_ctx_t *);
static int errorexec_cleanup(i_ctx_t *);
static int zsetstackpr... | CWE-200 | null | null |
1,885 | interp_reclaim(i_ctx_t **pi_ctx_p, int space)
{
i_ctx_t *i_ctx_p = *pi_ctx_p;
gs_gc_root_t ctx_root;
int code;
#ifdef DEBUG
if (gs_debug_c(gs_debug_flag_gc_disable))
return 0;
#endif
gs_register_struct_root(imemory_system, &ctx_root,
(void **)pi_ctx_p, "interp_r... | Bypass +Info | 0 | interp_reclaim(i_ctx_t **pi_ctx_p, int space)
{
i_ctx_t *i_ctx_p = *pi_ctx_p;
gs_gc_root_t ctx_root;
int code;
#ifdef DEBUG
if (gs_debug_c(gs_debug_flag_gc_disable))
return 0;
#endif
gs_register_struct_root(imemory_system, &ctx_root,
(void **)pi_ctx_p, "interp_r... | @@ -142,7 +142,6 @@ static int oparray_pop(i_ctx_t *);
static int oparray_cleanup(i_ctx_t *);
static int zerrorexec(i_ctx_t *);
static int zfinderrorobject(i_ctx_t *);
-static int errorexec_find(i_ctx_t *, ref *);
static int errorexec_pop(i_ctx_t *);
static int errorexec_cleanup(i_ctx_t *);
static int zsetstackpr... | CWE-200 | null | null |
1,886 | set_gc_signal(i_ctx_t *i_ctx_p, int value)
{
gs_memory_gc_status_t stat;
int i;
for (i = 0; i < countof(idmemory->spaces_indexed); i++) {
gs_ref_memory_t *mem = idmemory->spaces_indexed[i];
gs_ref_memory_t *mem_stable;
if (mem == 0)
continue;
for (;; mem = mem_s... | Bypass +Info | 0 | set_gc_signal(i_ctx_t *i_ctx_p, int value)
{
gs_memory_gc_status_t stat;
int i;
for (i = 0; i < countof(idmemory->spaces_indexed); i++) {
gs_ref_memory_t *mem = idmemory->spaces_indexed[i];
gs_ref_memory_t *mem_stable;
if (mem == 0)
continue;
for (;; mem = mem_s... | @@ -142,7 +142,6 @@ static int oparray_pop(i_ctx_t *);
static int oparray_cleanup(i_ctx_t *);
static int zerrorexec(i_ctx_t *);
static int zfinderrorobject(i_ctx_t *);
-static int errorexec_find(i_ctx_t *, ref *);
static int errorexec_pop(i_ctx_t *);
static int errorexec_cleanup(i_ctx_t *);
static int zsetstackpr... | CWE-200 | null | null |
1,887 | check_for_exec(const_os_ptr op)
{
if (!r_has_attr(op, a_execute) && /* only true if noaccess */
ref_type_uses_access(r_type(op)) &&
(r_has_attr(op, a_executable) || !r_has_type(op, t_dictionary))
) {
return_error(gs_error_invalidaccess);
}
return 0;
}
| Bypass +Info | 0 | check_for_exec(const_os_ptr op)
{
if (!r_has_attr(op, a_execute) && /* only true if noaccess */
ref_type_uses_access(r_type(op)) &&
(r_has_attr(op, a_executable) || !r_has_type(op, t_dictionary))
) {
return_error(gs_error_invalidaccess);
}
return 0;
}
| @@ -24,6 +24,7 @@
#include "ipacked.h"
#include "iutil.h"
#include "store.h"
+#include "interp.h"
/* Forward references */
static int check_for_exec(const_os_ptr);
@@ -787,7 +788,7 @@ zexecstack2(i_ctx_t *i_ctx_p)
/* Continuation operator to do the actual transfer. */
/* r_size(op1) was set just above. */
sta... | CWE-200 | null | null |
1,888 | count_exec_stack(i_ctx_t *i_ctx_p, bool include_marks)
{
uint count = ref_stack_count(&e_stack);
if (!include_marks) {
uint i;
for (i = count; i--;)
if (r_has_type_attrs(ref_stack_index(&e_stack, (long)i),
t_null, a_executable))
--co... | Bypass +Info | 0 | count_exec_stack(i_ctx_t *i_ctx_p, bool include_marks)
{
uint count = ref_stack_count(&e_stack);
if (!include_marks) {
uint i;
for (i = count; i--;)
if (r_has_type_attrs(ref_stack_index(&e_stack, (long)i),
t_null, a_executable))
--co... | @@ -24,6 +24,7 @@
#include "ipacked.h"
#include "iutil.h"
#include "store.h"
+#include "interp.h"
/* Forward references */
static int check_for_exec(const_os_ptr);
@@ -787,7 +788,7 @@ zexecstack2(i_ctx_t *i_ctx_p)
/* Continuation operator to do the actual transfer. */
/* r_size(op1) was set just above. */
sta... | CWE-200 | null | null |
1,889 | static char *have_snapdir(struct vfs_handle_struct *handle,
const char *path)
{
struct smb_filename smb_fname;
int ret;
struct shadow_copy2_config *config;
SMB_VFS_HANDLE_GET_DATA(handle, config, struct shadow_copy2_config,
return NULL);
ZERO_STRUCT(smb_fname);
smb_fname.base_name = talloc_asprintf(tal... | +Info | 0 | static char *have_snapdir(struct vfs_handle_struct *handle,
const char *path)
{
struct smb_filename smb_fname;
int ret;
struct shadow_copy2_config *config;
SMB_VFS_HANDLE_GET_DATA(handle, config, struct shadow_copy2_config,
return NULL);
ZERO_STRUCT(smb_fname);
smb_fname.base_name = talloc_asprintf(tal... | @@ -30,6 +30,7 @@
*/
#include "includes.h"
+#include "smbd/smbd.h"
#include "system/filesys.h"
#include "include/ntioctl.h"
#include "util_tdb.h"
@@ -1180,6 +1181,42 @@ static char *have_snapdir(struct vfs_handle_struct *handle,
return NULL;
}
+static bool check_access_snapdir(struct vfs_handle_struc... | CWE-200 | null | null |
1,890 | static int shadow_copy2_chmod(vfs_handle_struct *handle, const char *fname,
mode_t mode)
{
time_t timestamp;
char *stripped;
int ret, saved_errno;
char *conv;
if (!shadow_copy2_strip_snapshot(talloc_tos(), handle, fname,
×tamp, &stripped)) {
return -1;
}
if (timestamp == 0) {
return SMB_... | +Info | 0 | static int shadow_copy2_chmod(vfs_handle_struct *handle, const char *fname,
mode_t mode)
{
time_t timestamp;
char *stripped;
int ret, saved_errno;
char *conv;
if (!shadow_copy2_strip_snapshot(talloc_tos(), handle, fname,
×tamp, &stripped)) {
return -1;
}
if (timestamp == 0) {
return SMB_... | @@ -30,6 +30,7 @@
*/
#include "includes.h"
+#include "smbd/smbd.h"
#include "system/filesys.h"
#include "include/ntioctl.h"
#include "util_tdb.h"
@@ -1180,6 +1181,42 @@ static char *have_snapdir(struct vfs_handle_struct *handle,
return NULL;
}
+static bool check_access_snapdir(struct vfs_handle_struc... | CWE-200 | null | null |
1,891 | static char *shadow_copy2_convert(TALLOC_CTX *mem_ctx,
struct vfs_handle_struct *handle,
const char *name, time_t timestamp)
{
struct smb_filename converted_fname;
char *result = NULL;
size_t *slashes = NULL;
unsigned num_slashes;
char *path = NULL;
size_t pathlen;
char *insert = NULL;
char *convert... | +Info | 0 | static char *shadow_copy2_convert(TALLOC_CTX *mem_ctx,
struct vfs_handle_struct *handle,
const char *name, time_t timestamp)
{
struct smb_filename converted_fname;
char *result = NULL;
size_t *slashes = NULL;
unsigned num_slashes;
char *path = NULL;
size_t pathlen;
char *insert = NULL;
char *convert... | @@ -30,6 +30,7 @@
*/
#include "includes.h"
+#include "smbd/smbd.h"
#include "system/filesys.h"
#include "include/ntioctl.h"
#include "util_tdb.h"
@@ -1180,6 +1181,42 @@ static char *have_snapdir(struct vfs_handle_struct *handle,
return NULL;
}
+static bool check_access_snapdir(struct vfs_handle_struc... | CWE-200 | null | null |
1,892 | static char *shadow_copy2_find_mount_point(TALLOC_CTX *mem_ctx,
vfs_handle_struct *handle)
{
char *path = talloc_strdup(mem_ctx, handle->conn->connectpath);
dev_t dev;
struct stat st;
char *p;
if (stat(path, &st) != 0) {
talloc_free(path);
return NULL;
}
dev = st.st_dev;
while ((p = strrchr(path,... | +Info | 0 | static char *shadow_copy2_find_mount_point(TALLOC_CTX *mem_ctx,
vfs_handle_struct *handle)
{
char *path = talloc_strdup(mem_ctx, handle->conn->connectpath);
dev_t dev;
struct stat st;
char *p;
if (stat(path, &st) != 0) {
talloc_free(path);
return NULL;
}
dev = st.st_dev;
while ((p = strrchr(path,... | @@ -30,6 +30,7 @@
*/
#include "includes.h"
+#include "smbd/smbd.h"
#include "system/filesys.h"
#include "include/ntioctl.h"
#include "util_tdb.h"
@@ -1180,6 +1181,42 @@ static char *have_snapdir(struct vfs_handle_struct *handle,
return NULL;
}
+static bool check_access_snapdir(struct vfs_handle_struc... | CWE-200 | null | null |
1,893 | static int shadow_copy2_fstat(vfs_handle_struct *handle, files_struct *fsp,
SMB_STRUCT_STAT *sbuf)
{
time_t timestamp;
int ret;
ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
if (ret == -1) {
return ret;
}
if (!shadow_copy2_strip_snapshot(talloc_tos(), handle,
fsp->fsp_name->base_name,
&time... | +Info | 0 | static int shadow_copy2_fstat(vfs_handle_struct *handle, files_struct *fsp,
SMB_STRUCT_STAT *sbuf)
{
time_t timestamp;
int ret;
ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
if (ret == -1) {
return ret;
}
if (!shadow_copy2_strip_snapshot(talloc_tos(), handle,
fsp->fsp_name->base_name,
&time... | @@ -30,6 +30,7 @@
*/
#include "includes.h"
+#include "smbd/smbd.h"
#include "system/filesys.h"
#include "include/ntioctl.h"
#include "util_tdb.h"
@@ -1180,6 +1181,42 @@ static char *have_snapdir(struct vfs_handle_struct *handle,
return NULL;
}
+static bool check_access_snapdir(struct vfs_handle_struc... | CWE-200 | null | null |
1,894 | static uint16_t smb1cli_alloc_mid(struct smbXcli_conn *conn)
{
size_t num_pending = talloc_array_length(conn->pending);
uint16_t result;
if (conn->protocol == PROTOCOL_NONE) {
/*
* This is what windows sends on the SMB1 Negprot request
* and some vendors reuse the SMB1 MID as SMB2 sequence number.
*/
r... | null | 0 | static uint16_t smb1cli_alloc_mid(struct smbXcli_conn *conn)
{
size_t num_pending = talloc_array_length(conn->pending);
uint16_t result;
if (conn->protocol == PROTOCOL_NONE) {
/*
* This is what windows sends on the SMB1 Negprot request
* and some vendors reuse the SMB1 MID as SMB2 sequence number.
*/
r... | @@ -5446,6 +5446,9 @@ uint8_t smb2cli_session_security_mode(struct smbXcli_session *session)
if (conn->mandatory_signing) {
security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
}
+ if (session->smb2->should_sign) {
+ security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
+ ... | CWE-20 | null | null |
1,895 | bool smb1cli_conn_activate_signing(struct smbXcli_conn *conn,
const DATA_BLOB user_session_key,
const DATA_BLOB response)
{
return smb_signing_activate(conn->smb1.signing,
user_session_key,
response);
}
| null | 0 | bool smb1cli_conn_activate_signing(struct smbXcli_conn *conn,
const DATA_BLOB user_session_key,
const DATA_BLOB response)
{
return smb_signing_activate(conn->smb1.signing,
user_session_key,
response);
}
| @@ -5446,6 +5446,9 @@ uint8_t smb2cli_session_security_mode(struct smbXcli_session *session)
if (conn->mandatory_signing) {
security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
}
+ if (session->smb2->should_sign) {
+ security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
+ ... | CWE-20 | null | null |
1,896 | uint32_t smb1cli_conn_capabilities(struct smbXcli_conn *conn)
{
return conn->smb1.capabilities;
}
| null | 0 | uint32_t smb1cli_conn_capabilities(struct smbXcli_conn *conn)
{
return conn->smb1.capabilities;
}
| @@ -5446,6 +5446,9 @@ uint8_t smb2cli_session_security_mode(struct smbXcli_session *session)
if (conn->mandatory_signing) {
security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
}
+ if (session->smb2->should_sign) {
+ security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
+ ... | CWE-20 | null | null |
1,897 | bool smb1cli_conn_check_signing(struct smbXcli_conn *conn,
const uint8_t *buf, uint32_t seqnum)
{
const uint8_t *hdr = buf + NBT_HDR_SIZE;
size_t len = smb_len_nbt(buf);
return smb_signing_check_pdu(conn->smb1.signing, hdr, len, seqnum);
}
| null | 0 | bool smb1cli_conn_check_signing(struct smbXcli_conn *conn,
const uint8_t *buf, uint32_t seqnum)
{
const uint8_t *hdr = buf + NBT_HDR_SIZE;
size_t len = smb_len_nbt(buf);
return smb_signing_check_pdu(conn->smb1.signing, hdr, len, seqnum);
}
| @@ -5446,6 +5446,9 @@ uint8_t smb2cli_session_security_mode(struct smbXcli_session *session)
if (conn->mandatory_signing) {
security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
}
+ if (session->smb2->should_sign) {
+ security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
+ ... | CWE-20 | null | null |
1,898 | static NTSTATUS smb1cli_conn_dispatch_incoming(struct smbXcli_conn *conn,
TALLOC_CTX *tmp_mem,
uint8_t *inbuf)
{
struct tevent_req *req;
struct smbXcli_req_state *state;
NTSTATUS status;
size_t num_pending;
size_t i;
uint8_t cmd;
uint16_t mid;
bool oplock_break;
uint8_t *inhdr = inbuf +... | null | 0 | static NTSTATUS smb1cli_conn_dispatch_incoming(struct smbXcli_conn *conn,
TALLOC_CTX *tmp_mem,
uint8_t *inbuf)
{
struct tevent_req *req;
struct smbXcli_req_state *state;
NTSTATUS status;
size_t num_pending;
size_t i;
uint8_t cmd;
uint16_t mid;
bool oplock_break;
uint8_t *inhdr = inbuf +... | @@ -5446,6 +5446,9 @@ uint8_t smb2cli_session_security_mode(struct smbXcli_session *session)
if (conn->mandatory_signing) {
security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
}
+ if (session->smb2->should_sign) {
+ security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
+ ... | CWE-20 | null | null |
1,899 | bool smb1cli_conn_encryption_on(struct smbXcli_conn *conn)
{
return common_encryption_on(conn->smb1.trans_enc);
}
| null | 0 | bool smb1cli_conn_encryption_on(struct smbXcli_conn *conn)
{
return common_encryption_on(conn->smb1.trans_enc);
}
| @@ -5446,6 +5446,9 @@ uint8_t smb2cli_session_security_mode(struct smbXcli_session *session)
if (conn->mandatory_signing) {
security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
}
+ if (session->smb2->should_sign) {
+ security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
+ ... | CWE-20 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.