Fix a couple of bugs, one in stralloc and one uninitialized ptr vector
This commit is contained in:
parent
6d30116ed9
commit
15d09ed57a
@ -1454,6 +1454,8 @@ int read_message(struct user_record *user, struct msg_headers *msghs, int mailno
|
||||
uuid_t magi_msgid;
|
||||
struct ptr_vector msg_lines;
|
||||
|
||||
init_ptr_vector(&msg_lines);
|
||||
|
||||
jb = open_jam_base(conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->path);
|
||||
if (!jb) {
|
||||
dolog("Error opening JAM base.. %s", conf.mail_conferences[user->cur_mail_conf]->mail_areas[user->cur_mail_area]->path);
|
||||
|
@ -16,7 +16,7 @@ int stralloc_ready(stralloc *sa, size_t n) {
|
||||
sa->s = malloc(n);
|
||||
return sa != NULL;
|
||||
}
|
||||
if (sa->a <= n)
|
||||
if (sa->a >= n)
|
||||
return 1;
|
||||
na = 30 + n + (n >> 3);
|
||||
ns = realloc(sa->s, na);
|
||||
|
Reference in New Issue
Block a user