mirror of
https://github.com/samba-team/samba.git
synced 2025-11-09 20:23:51 +03:00
r23510: Tidy calls to smb_panic by removing trailing newlines. Print the
failed expression in SMB_ASSERT.
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
24b0cbcb37
commit
171dc060e2
@@ -66,7 +66,7 @@ TALLOC_CTX *main_loop_talloc_get(void)
|
||||
if (!main_loop_talloc) {
|
||||
main_loop_talloc = talloc_init("main loop talloc (mainly parse_misc)");
|
||||
if (!main_loop_talloc)
|
||||
smb_panic("main_loop_talloc: malloc fail\n");
|
||||
smb_panic("main_loop_talloc: malloc fail");
|
||||
}
|
||||
|
||||
return main_loop_talloc;
|
||||
@@ -452,7 +452,7 @@ void init_unistr(UNISTR *str, const char *buf)
|
||||
if (len) {
|
||||
str->buffer = TALLOC_ZERO_ARRAY(get_talloc_ctx(), uint16, len);
|
||||
if (str->buffer == NULL)
|
||||
smb_panic("init_unistr: malloc fail\n");
|
||||
smb_panic("init_unistr: malloc fail");
|
||||
|
||||
rpcstr_push(str->buffer, buf, len*sizeof(uint16), STR_TERMINATE);
|
||||
} else {
|
||||
@@ -488,7 +488,7 @@ static void create_rpc_blob(RPC_DATA_BLOB *str, size_t len)
|
||||
if (len) {
|
||||
str->buffer = (uint8 *)TALLOC_ZERO(get_talloc_ctx(), len);
|
||||
if (str->buffer == NULL)
|
||||
smb_panic("create_rpc_blob: talloc fail\n");
|
||||
smb_panic("create_rpc_blob: talloc fail");
|
||||
str->buf_len = len;
|
||||
} else {
|
||||
str->buffer = NULL;
|
||||
@@ -595,7 +595,7 @@ void init_regval_buffer(REGVAL_BUFFER *str, const uint8 *buf, size_t len)
|
||||
str->buffer = (uint16 *)TALLOC_ZERO(get_talloc_ctx(),
|
||||
str->buf_max_len);
|
||||
if (str->buffer == NULL)
|
||||
smb_panic("init_regval_buffer: talloc fail\n");
|
||||
smb_panic("init_regval_buffer: talloc fail");
|
||||
memcpy(str->buffer, buf, str->buf_len);
|
||||
}
|
||||
}
|
||||
@@ -671,7 +671,7 @@ void copy_unistr2(UNISTR2 *str, const UNISTR2 *from)
|
||||
if (str->uni_max_len) {
|
||||
str->buffer = (uint16 *)TALLOC_ZERO_ARRAY(get_talloc_ctx(), uint16, str->uni_max_len);
|
||||
if ((str->buffer == NULL)) {
|
||||
smb_panic("copy_unistr2: talloc fail\n");
|
||||
smb_panic("copy_unistr2: talloc fail");
|
||||
return;
|
||||
}
|
||||
/* copy the string */
|
||||
@@ -705,7 +705,7 @@ void init_string2(STRING2 *str, const char *buf, size_t max_len, size_t str_len)
|
||||
str->buffer = (uint8 *)TALLOC_ZERO(get_talloc_ctx(),
|
||||
str->str_max_len);
|
||||
if (str->buffer == NULL)
|
||||
smb_panic("init_string2: malloc fail\n");
|
||||
smb_panic("init_string2: malloc fail");
|
||||
memcpy(str->buffer, buf, str_len);
|
||||
}
|
||||
}
|
||||
@@ -781,7 +781,7 @@ void init_unistr2(UNISTR2 *str, const char *buf, enum unistr2_term_codes flags)
|
||||
|
||||
str->buffer = TALLOC_ZERO_ARRAY(get_talloc_ctx(), uint16, len);
|
||||
if (str->buffer == NULL) {
|
||||
smb_panic("init_unistr2: malloc fail\n");
|
||||
smb_panic("init_unistr2: malloc fail");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -817,7 +817,7 @@ void init_unistr4(UNISTR4 *uni4, const char *buf, enum unistr2_term_codes flags)
|
||||
{
|
||||
uni4->string = TALLOC_P( get_talloc_ctx(), UNISTR2 );
|
||||
if (!uni4->string) {
|
||||
smb_panic("init_unistr4: talloc fail\n");
|
||||
smb_panic("init_unistr4: talloc fail");
|
||||
return;
|
||||
}
|
||||
init_unistr2( uni4->string, buf, flags );
|
||||
@@ -830,7 +830,7 @@ void init_unistr4_w( TALLOC_CTX *ctx, UNISTR4 *uni4, const smb_ucs2_t *buf )
|
||||
{
|
||||
uni4->string = TALLOC_P( ctx, UNISTR2 );
|
||||
if (!uni4->string) {
|
||||
smb_panic("init_unistr4_w: talloc fail\n");
|
||||
smb_panic("init_unistr4_w: talloc fail");
|
||||
return;
|
||||
}
|
||||
init_unistr2_w( ctx, uni4->string, buf );
|
||||
@@ -860,7 +860,7 @@ void init_unistr2_w(TALLOC_CTX *ctx, UNISTR2 *str, const smb_ucs2_t *buf)
|
||||
if (len + 1) {
|
||||
str->buffer = TALLOC_ZERO_ARRAY(ctx, uint16, len + 1);
|
||||
if (str->buffer == NULL) {
|
||||
smb_panic("init_unistr2_w: talloc fail\n");
|
||||
smb_panic("init_unistr2_w: talloc fail");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@@ -916,7 +916,7 @@ void init_unistr2_from_unistr(UNISTR2 *to, const UNISTR *from)
|
||||
if (i) {
|
||||
to->buffer = TALLOC_ZERO_ARRAY(get_talloc_ctx(), uint16, i);
|
||||
if (to->buffer == NULL)
|
||||
smb_panic("init_unistr2_from_unistr: malloc fail\n");
|
||||
smb_panic("init_unistr2_from_unistr: malloc fail");
|
||||
memcpy(to->buffer, from->buffer, i*sizeof(uint16));
|
||||
} else {
|
||||
to->buffer = NULL;
|
||||
@@ -945,7 +945,7 @@ void init_unistr2_from_datablob(UNISTR2 *str, DATA_BLOB *blob)
|
||||
str->buffer = NULL;
|
||||
}
|
||||
if ((str->buffer == NULL) && (blob->length > 0)) {
|
||||
smb_panic("init_unistr2_from_datablob: malloc fail\n");
|
||||
smb_panic("init_unistr2_from_datablob: malloc fail");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1710,7 +1710,7 @@ void init_unistr3(UNISTR3 *str, const char *buf)
|
||||
if (str->uni_str_len) {
|
||||
str->str.buffer = TALLOC_ZERO_ARRAY(get_talloc_ctx(), uint16, str->uni_str_len);
|
||||
if (str->str.buffer == NULL)
|
||||
smb_panic("init_unistr3: malloc fail\n");
|
||||
smb_panic("init_unistr3: malloc fail");
|
||||
|
||||
rpcstr_push((char *)str->str.buffer, buf, str->uni_str_len * sizeof(uint16), STR_TERMINATE);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user