token = t_strsplit_spaces(answer, " ");
if (token[0] == NULL ||
(token[1] == NULL && strcmp(token[0], "BH") != 0) ||
- (token[2] == NULL && gss_spnego)) {
+ (gss_spnego && (token[1] == NULL || token[2] == NULL))) {
auth_request_log_error(auth_request, "winbind",
"Invalid input from helper: %s", answer);
return HR_RESTART;
const char *user, *p, *error;
user = gss_spnego ? token[2] : token[1];
+ i_assert(user != NULL);
p = strchr(user, '\\');
if (p != NULL) {
{
struct config_filter_parser *const *src;
struct config_module_parser *dest;
- const char *error, **error_p;
+ const char *error = NULL, **error_p;
unsigned int i, count;
src = config_filter_find_all(ctx, module, filter, output_r);
if (config_module_parser_apply_changes(dest, src[i], pool,
error_p) < 0) {
+ i_assert(error != NULL);
config_filter_parsers_free(dest);
*error_r = error;
return -1;
void doveadm_register_cmd(const struct doveadm_cmd *cmd);
-void usage(void);
+void usage(void) ATTR_NORETURN;
void help(const struct doveadm_cmd *cmd);
const char *unixdate2str(time_t timestamp);
if (!mail_index_map_lookup_ext(map, name, &ext_map_idx))
ext_map_idx = (uint32_t)-1;
}
- ext = ext_map_idx == (uint32_t)-1 ? NULL :
- array_idx(&map->extensions, ext_map_idx);
- if (ext != NULL)
+ if (ext_map_idx == (uint32_t)-1)
+ ext = NULL;
+ else {
+ ext = array_idx(&map->extensions, ext_map_idx);
name = ext->name;
+ }
+ i_assert(name != NULL);
if (!ctx->internal_update &&
strcmp(name, MAIL_INDEX_EXT_KEYWORDS) == 0) {
return -1;
}
- if (ext_map_idx != (uint32_t)-1) {
+ if (ext != NULL) {
/* exists already */
if (u->reset_id == ext->reset_id) {
/* check if we need to resize anything */
view->head = file;
file = file->next;
}
+ i_assert(view->tail != NULL);
if (min_file_offset == 0) {
/* beginning of the file */
struct message_block *output)
{
const unsigned char *data = NULL;
- size_t pos, size = 0;
+ size_t pos = 0, size = 0;
int ret;
if (ctx->encoding_buf->used != 0) {
}
nodes[i].sort_id_changed = TRUE;
}
+ i_assert(str != NULL);
+
return right_str == NULL || strcmp(str, right_str) < 0 ||
(strcmp(str, right_str) == 0 &&
nodes[i-1].sort_id == right_sort_id) ? 0 : -1;
SEARCH_OR : SEARCH_SUB;
args->not = FALSE;
sub = args->value.subargs;
- for (; sub != NULL; sub = sub->next)
+ do {
sub->not = !sub->not;
+ sub = sub->next;
+ } while (sub != NULL);
}
if ((args->type == SEARCH_SUB && parent_and) ||
unsigned int i, count;
pool_t pool;
+ i_assert(environ != NULL);
+
for (count = 0; environ[count] != NULL; count++) ;
pool = pool_alloconly_create("saved environment", 4096);
test_istream_set_allow_eof(streams[i], TRUE);
}
streams[i] = NULL;
+ i_assert(offset > 0);
input = i_stream_create_concat(streams);
for (i = 0; i < 100; i++) {
test_istream_set_allow_eof(streams[i], TRUE);
}
streams[i] = NULL;
+ i_assert(offset > 0);
buffer_size = (rand() % 100) + 1; size = 0;
input = i_stream_create_seekable(streams, buffer_size, fd_callback, NULL);
struct expire_mailbox *xpr_box = EXPIRE_CONTEXT(t->box);
struct expire_transaction_context *xt = EXPIRE_CONTEXT(t);
struct mailbox *box = t->box;
- time_t new_stamp;
+ time_t new_stamp = 0;
bool update_dict = FALSE;
int ret;