Merge branch 'master' into nntp
authorArt Cancro <ajc@uncensored.citadel.org>
Tue, 4 Feb 2014 20:20:56 +0000 (15:20 -0500)
committerArt Cancro <ajc@uncensored.citadel.org>
Tue, 4 Feb 2014 20:20:56 +0000 (15:20 -0500)
14 files changed:
citadel/euidindex.c
citadel/include/ctdl_module.h
citadel/modules/ctdlproto/serv_rooms.c
citadel/modules/imap/imap_acl.c
citadel/modules/imap/imap_metadata.c
citadel/modules/imap/imap_misc.c
citadel/modules/imap/serv_imap.c
citadel/modules/sieve/serv_sieve.c
citadel/modules/smtp/serv_smtp.c
citadel/modules/vcard/serv_vcard.c
citadel/msgbase.c
citadel/room_ops.c
citadel/user_ops.c
libcitadel/lib/stringbuf.c

index 38968219bfc4b4cfadc2d438abadb07352a79feb..aa41d50dcc8c0149a16e810683a56e4ae3dbd9b0 100644 (file)
@@ -162,7 +162,7 @@ void rebuild_euid_index_for_room(struct ctdlroom *qrbuf, void *data) {
                                syslog(LOG_DEBUG,
                                        "Rebuilding EUID index for <%s>\n",
                                        rplist->name);
-                               CtdlUserGoto(rplist->name, 0, 0, NULL, NULL);
+                               CtdlUserGoto(rplist->name, 0, 0, NULL, NULL, NULL, NULL);
                                CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL,
                                        rebuild_euid_index_for_msg, NULL);
                        }
index 9f74e34994e6ddb1aaf8c51a373e30602bc67d26..7a8b5250da83f64edd1d8e1f535bd422a002be4e 100644 (file)
@@ -247,21 +247,16 @@ unsigned CtdlCreateRoom(char *new_room_name,
 int CtdlGetRoom(struct ctdlroom *qrbuf, const char *room_name);
 int CtdlGetRoomLock(struct ctdlroom *qrbuf, char *room_name);
 int CtdlDoIHavePermissionToDeleteThisRoom(struct ctdlroom *qr);
-void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf,
-               int *result, int *view);
+void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf, int *result, int *view);
 void CtdlPutRoomLock(struct ctdlroom *qrbuf);
 typedef void (*ForEachRoomCallBack)(struct ctdlroom *EachRoom, void *out_data);
 void CtdlForEachRoom(ForEachRoomCallBack CB, void *in_data);
 typedef void (*ForEachRoomNetCfgCallBack)(struct ctdlroom *EachRoom, void *out_data, OneRoomNetCfg *OneRNCFG);
-void CtdlForEachNetCfgRoom(ForEachRoomNetCfgCallBack CB,
-                          void *in_data,
-                          RoomNetCfg filter);
+void CtdlForEachNetCfgRoom(ForEachRoomNetCfgCallBack CB, void *in_data, RoomNetCfg filter);
 void SaveChangedConfigs(void);
-
 void CtdlDeleteRoom(struct ctdlroom *qrbuf);
 int CtdlRenameRoom(char *old_name, char *new_name, int new_floor);
-void CtdlUserGoto (char *where, int display_result, int transiently,
-                       int *msgs, int *new);
+void CtdlUserGoto (char *where, int display_result, int transiently, int *msgs, int *new, long *oldest, long *newest);
 struct floor *CtdlGetCachedFloor(int floor_num);
 void CtdlScheduleRoomForDeletion(struct ctdlroom *qrbuf);
 void CtdlGetFloor (struct floor *flbuf, int floor_num);
index deeeb813360d9874d8d9d7863ac174b1b66066a9..14673274baabd90bd5e0318b7d4bf7ac3754cae2 100644 (file)
@@ -306,7 +306,7 @@ void cmd_goto(char *gargs)
                if (CC->internal_pgm) {
                        memcpy(&CC->room, &QRscratch,
                                sizeof(struct ctdlroom));
-                       CtdlUserGoto(NULL, 1, transiently, NULL, NULL);
+                       CtdlUserGoto(NULL, 1, transiently, NULL, NULL, NULL, NULL);
                        return;
                }
 
@@ -323,7 +323,7 @@ void cmd_goto(char *gargs)
                            ((ra & UA_GOTOALLOWED))) {
                                memcpy(&CC->room, &QRscratch,
                                        sizeof(struct ctdlroom));
-                               CtdlUserGoto(NULL, 1, transiently, NULL, NULL);
+                               CtdlUserGoto(NULL, 1, transiently, NULL, NULL, NULL, NULL);
                                return;
                        } else if ((QRscratch.QRflags & QR_PASSWORDED) &&
                            ((ra & UA_KNOWN) == 0) &&
@@ -343,7 +343,7 @@ void cmd_goto(char *gargs)
                        } else {
                                memcpy(&CC->room, &QRscratch,
                                        sizeof(struct ctdlroom));
-                               CtdlUserGoto(NULL, 1, transiently, NULL, NULL);
+                               CtdlUserGoto(NULL, 1, transiently, NULL, NULL, NULL, NULL);
                                return;
                        }
                }
@@ -761,7 +761,7 @@ void cmd_kill(char *argbuf)
                CtdlScheduleRoomForDeletion(&CC->room);
 
                /* Return to the Lobby */
-               CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL);
+               CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL, NULL, NULL);
 
                /* tell the world what we did */
                snprintf(msg, sizeof msg, "The room \"%s\" has been deleted by %s.\n",
index 0cd272860dfd887c4cff122d3421360cd7517c02..207a32817c1bce11f7cd6dd96dc436ac455ad9bb 100644 (file)
@@ -171,7 +171,7 @@ void imap_getacl(int num_parms, ConstStr *Params) {
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL);
 
        IAPuts("* ACL ");
        IPutCParamStr(2);
@@ -206,7 +206,7 @@ void imap_getacl(int num_parms, ConstStr *Params) {
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new, NULL, NULL);
        }
 
        IReply("OK GETACL completed");
@@ -261,7 +261,7 @@ void imap_listrights(int num_parms, ConstStr *Params) {
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL);
 
        /*
         * Now output the list of rights
@@ -279,7 +279,7 @@ void imap_listrights(int num_parms, ConstStr *Params) {
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new, NULL, NULL);
        }
 
        IReply("OK LISTRIGHTS completed");
@@ -316,7 +316,7 @@ void imap_myrights(int num_parms, ConstStr *Params) {
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL);
 
        CtdlRoomAccess(&CC->room, &CC->user, &ra, NULL);
        rights = NewStrBuf();
@@ -334,7 +334,7 @@ void imap_myrights(int num_parms, ConstStr *Params) {
         * If a different folder was previously selected, return there now.
         */
        if ( (IMAP->selected) && (strcasecmp(roomname, savedroom)) ) {
-               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new, NULL, NULL);
        }
 
        IReply("OK MYRIGHTS completed");
index 705448e459f6d5b2ea5f3474d58f8507b372327b..e9ea55ee9acdc3dcbf4222045cca47562c8f2e69 100644 (file)
@@ -147,7 +147,7 @@ void imap_setmetadata(int num_parms, ConstStr *Params) {
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL);
 
        /*
         * Always set the per-user view to the requested one.
@@ -187,7 +187,7 @@ void imap_setmetadata(int num_parms, ConstStr *Params) {
         * If a different folder was previously selected, return there now.
         */
        if ( (IMAP->selected) && (strcasecmp(roomname, savedroom)) ) {
-               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new, NULL, NULL);
        }
        return;
 }
@@ -226,7 +226,7 @@ void imap_getmetadata(int num_parms, ConstStr *Params) {
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL);
 
        IAPuts("* METADATA ");
        IPutCParamStr(2);
@@ -304,7 +304,7 @@ void imap_getmetadata(int num_parms, ConstStr *Params) {
         * If a different folder was previously selected, return there now.
         */
        if ( (IMAP->selected) && (strcasecmp(roomname, savedroom)) ) {
-               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new, NULL, NULL);
        }
 
        IReply("OK GETMETADATA complete");
index 5cfe8be8fcf93177b4b59c4280051ab96d38b109..5b501e4e7aba575f2018fef4b04715115a1e0306 100644 (file)
@@ -374,7 +374,7 @@ void imap_append(int num_parms, ConstStr *Params) {
        if (Imap->selected) {
                strcpy(savedroom, CCC->room.QRname);
        }
-       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL);
 
        /* If the user is locally authenticated, FORCE the From: header to
         * show up as the real sender.  FIXME do we really want to do this?
@@ -424,7 +424,7 @@ void imap_append(int num_parms, ConstStr *Params) {
         * our happy day without violent explosions.
         */
        if (Imap->selected) {
-               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new, NULL, NULL);
        }
 
        /* We don't need this buffer anymore */
index 4b3e146cef6f40ef696311400cf4627811fe8f28..d49b8d85403a475907b781d5fb146bdd6a078fe7 100644 (file)
@@ -708,26 +708,37 @@ void imap_auth_plain(void)
        char user[256] = "";
        char pass[256] = "";
        int result;
-       long len;
+       long decoded_len;
+       long len = 0;
+       long plen = 0;
 
        memset(pass, 0, sizeof(pass));
-       len = StrBufDecodeBase64(Imap->Cmd.CmdBuf);
+       decoded_len = StrBufDecodeBase64(Imap->Cmd.CmdBuf);
 
-       if (len > 0)
+       if (decoded_len > 0)
        {
                decoded_authstring = ChrPtr(Imap->Cmd.CmdBuf);
 
                len = safestrncpy(ident, decoded_authstring, sizeof ident);
 
+               decoded_len -= len - 1;
                decoded_authstring += len + 1;
 
-               len = safestrncpy(user, decoded_authstring, sizeof user);
+               if (decoded_len > 0)
+               {
+                       len = safestrncpy(user, decoded_authstring, sizeof user);
 
-               decoded_authstring += len + 1;
+                       decoded_authstring += len + 1;
+                       decoded_len -= len - 1;
+               }
+
+               if (decoded_len > 0)
+               {
+                       plen = safestrncpy(pass, decoded_authstring, sizeof pass);
 
-               len = safestrncpy(pass, decoded_authstring, sizeof pass);
-               if (len < 0)
-                       len = sizeof(pass) - 1;
+                       if (plen < 0)
+                               plen = sizeof(pass) - 1;
+               }
        }
        Imap->authstate = imap_as_normal;
 
@@ -739,7 +750,7 @@ void imap_auth_plain(void)
        }
 
        if (result == login_ok) {
-               if (CtdlTryPassword(pass, len) == pass_ok) {
+               if (CtdlTryPassword(pass, plen) == pass_ok) {
                        IAPrintf("%s OK authentication succeeded\r\n", Imap->authseq);
                        return;
                }
@@ -879,7 +890,7 @@ void imap_select(int num_parms, ConstStr *Params)
         * the number of messages and number of new messages.
         */
        memcpy(&CC->room, &QRscratch, sizeof(struct ctdlroom));
-       CtdlUserGoto(NULL, 0, 0, &msgs, &new);
+       CtdlUserGoto(NULL, 0, 0, &msgs, &new, NULL, NULL);
        Imap->selected = 1;
 
        if (!strcasecmp(Params[1].Key, "EXAMINE")) {
@@ -1185,7 +1196,7 @@ void imap_status(int num_parms, ConstStr *Params)
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL);
 
        /*
         * Tell the client what it wants to know.  In fact, tell it *more* than
@@ -1206,7 +1217,7 @@ void imap_status(int num_parms, ConstStr *Params)
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new, NULL, NULL);
        }
 
        /*
@@ -1244,14 +1255,14 @@ void imap_subscribe(int num_parms, ConstStr *Params)
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL);
 
        /*
         * If another folder is selected, go back to that room so we can resume
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new, NULL, NULL);
        }
 
        IReply("OK SUBSCRIBE completed");
@@ -1281,7 +1292,7 @@ void imap_unsubscribe(int num_parms, ConstStr *Params)
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL);
 
        /* 
         * Now make the API call to zap the room
@@ -1297,7 +1308,7 @@ void imap_unsubscribe(int num_parms, ConstStr *Params)
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new, NULL, NULL);
        }
 }
 
@@ -1327,7 +1338,7 @@ void imap_delete(int num_parms, ConstStr *Params)
        if (IMAP->selected) {
                strcpy(savedroom, CC->room.QRname);
        }
-       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL);
 
        /*
         * Now delete the room.
@@ -1344,7 +1355,7 @@ void imap_delete(int num_parms, ConstStr *Params)
         * our happy day without violent explosions.
         */
        if (IMAP->selected) {
-               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new, NULL, NULL);
        }
 }
 
index daf067331bf6a7db8eb0b273a21bd0dbb3d4afe3..ed69de8587f600d5cb00a265cc63d3085a7f9b32 100644 (file)
@@ -193,13 +193,13 @@ int ctdl_fileinto(sieve2_context_t *s, void *my)
        }
 
        /* Yes, we actually have to go there */
-       CtdlUserGoto(NULL, 0, 0, NULL, NULL);
+       CtdlUserGoto(NULL, 0, 0, NULL, NULL, NULL, NULL);
 
        c = CtdlSaveMsgPointersInRoom(NULL, &cs->msgnum, 1, 0, NULL, 0);
 
        /* Go back to the room we came from */
        if (strcasecmp(original_room_name, CC->room.QRname)) {
-               CtdlUserGoto(original_room_name, 0, 0, NULL, NULL);
+               CtdlUserGoto(original_room_name, 0, 0, NULL, NULL, NULL, NULL);
        }
 
        if (c == 0) {
index ece85545f85613712c737b483150304acca240db..892d8e7a7885d4aef9e851923284b9e0a9057333 100644 (file)
@@ -444,24 +444,38 @@ void smtp_try_plain(long offset, long Flags)
        char user[256] = "";
        char pass[256] = "";
        int result;
-       long len;
 
-       len = StrBufDecodeBase64(sSMTP->Cmd);
-       if (len > 0)
+       long decoded_len;
+       long len = 0;
+       long plen = 0;
+
+       memset(pass, 0, sizeof(pass));
+       decoded_len = StrBufDecodeBase64(sSMTP->Cmd);
+
+       if (decoded_len > 0)
        {
                decoded_authstring = ChrPtr(sSMTP->Cmd);
 
                len = safestrncpy(ident, decoded_authstring, sizeof ident);
 
+               decoded_len -= len - 1;
                decoded_authstring += len + 1;
 
-               len = safestrncpy(user, decoded_authstring, sizeof user);
+               if (decoded_len > 0)
+               {
+                       len = safestrncpy(user, decoded_authstring, sizeof user);
 
-               decoded_authstring += len + 1;
+                       decoded_authstring += len + 1;
+                       decoded_len -= len - 1;
+               }
+
+               if (decoded_len > 0)
+               {
+                       plen = safestrncpy(pass, decoded_authstring, sizeof pass);
 
-               len = safestrncpy(pass, decoded_authstring, sizeof pass);
-               if (len < 0)
-                       len = sizeof(pass) - 1;
+                       if (plen < 0)
+                               plen = sizeof(pass) - 1;
+               }
        }
 
        sSMTP->command_state = smtp_command;
@@ -474,7 +488,7 @@ void smtp_try_plain(long offset, long Flags)
        }
 
        if (result == login_ok) {
-               if (CtdlTryPassword(pass, len) == pass_ok) {
+               if (CtdlTryPassword(pass, plen) == pass_ok) {
                        smtp_webcit_preferences_hack();
                        smtp_auth_greeting(offset, Flags);
                        return;
index d143fc776e924bb87b7980b409e6efeb5f993092..e35bdf9331dbe3c06a87c1e0a4ed5b8273711c9c 100644 (file)
@@ -1363,7 +1363,7 @@ void store_this_ha(struct addresses_to_be_filed *aptr) {
        int i;
 
        /* First remove any addresses we already have in the address book */
-       CtdlUserGoto(aptr->roomname, 0, 0, NULL, NULL);
+       CtdlUserGoto(aptr->roomname, 0, 0, NULL, NULL, NULL, NULL);
        CtdlForEachMessage(MSGS_ALL, 0, NULL, "[Tt][Ee][Xx][Tt]/.*[Vv][Cc][Aa][Rr][Dd]$", NULL,
                strip_addresses_already_have, aptr->collected_addresses);
 
index 073410d182223e87fed4380b29d7cad120e5c2cb..22b41b38fa4a23765563289885ab45858cafa316 100644 (file)
@@ -2769,7 +2769,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
        MSG_syslog(LOG_INFO, "Final selection: %s (%s)\n", actual_rm, room);
        if (strcasecmp(actual_rm, CCC->room.QRname)) {
                /* CtdlGetRoom(&CCC->room, actual_rm); */
-               CtdlUserGoto(actual_rm, 0, 1, NULL, NULL);
+               CtdlUserGoto(actual_rm, 0, 1, NULL, NULL, NULL, NULL);
        }
 
        /*
@@ -2916,7 +2916,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
        /* Go back to the room we started from */
        MSG_syslog(LOG_DEBUG, "Returning to original room %s\n", hold_rm);
        if (strcasecmp(hold_rm, CCC->room.QRname))
-               CtdlUserGoto(hold_rm, 0, 1, NULL, NULL);
+               CtdlUserGoto(hold_rm, 0, 1, NULL, NULL, NULL, NULL);
 
        /*
         * Any addresses to harvest for someone's address book?
index 98c2acc20a936afdce6b1da6dc870bd08d50d289..729846d3eb0e12010935922a1cc2ad3e67a66e5b 100644 (file)
@@ -776,13 +776,15 @@ int CtdlIsNonEditable(struct ctdlroom *qrbuf)
  * specified room exists and is ok to access.
  */
 void CtdlUserGoto(char *where, int display_result, int transiently,
-               int *retmsgs, int *retnew)
+               int *retmsgs, int *retnew, long *retoldest, long *retnewest)
 {
        struct CitContext *CCC = CC;
        int a;
        int new_messages = 0;
        int old_messages = 0;
        int total_messages = 0;
+       long oldest_message = 0;
+       long newest_message = 0;
        int info = 0;
        int rmailflag;
        int raideflag;
@@ -850,6 +852,11 @@ void CtdlUserGoto(char *where, int display_result, int transiently,
                if (msglist[a] > 0L) ++total_messages;
        }
 
+       if (total_messages > 0) {
+               oldest_message = msglist[0];
+               newest_message = msglist[num_msgs - 1];
+       }
+
        num_sets = num_tokens(vbuf.v_seen, ',');
        for (s=0; s<num_sets; ++s) {
                extract_token(setstr, vbuf.v_seen, s, ',', sizeof setstr);
@@ -901,10 +908,11 @@ void CtdlUserGoto(char *where, int display_result, int transiently,
 
        if (retmsgs != NULL) *retmsgs = total_messages;
        if (retnew != NULL) *retnew = new_messages;
-       MSG_syslog(LOG_INFO, "<%s> %d new of %d total messages\n",
-                  CCC->room.QRname,
-                  new_messages, total_messages
-               );
+       if (retoldest != NULL) *retoldest = oldest_message;
+       if (retnewest != NULL) *retnewest = newest_message;
+       MSG_syslog(LOG_INFO, "<%s> %d new of %d total messages, oldest=%ld, newest=%ld\n",
+                  CCC->room.QRname, new_messages, total_messages, oldest_message, newest_message
+       );
 
        CCC->curr_view = (int)vbuf.v_view;
 
index c79e87abd04dd40c86e3e23a3c61297aa1ef7bb5..270ca87dbe48590d1093f81e34cee0c5b226dec9 100644 (file)
@@ -745,7 +745,7 @@ void do_login(void)
        PerformSessionHooks(EVT_LOGIN);
 
        /* Enter the lobby */
-       CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL);
+       CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL, NULL, NULL);
 }
 
 
@@ -1293,7 +1293,7 @@ int CtdlForgetThisRoom(void) {
        CtdlPutUserLock(&CC->user);
 
        /* Return to the Lobby, so we don't end up in an undefined room */
-       CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL);
+       CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL, NULL, NULL);
        return(0);
 
 }
index 5e89ea2f19b48f8c38edd1b5835f3754109f3379..436864690bd62d0af5eb9f638053de41ac9fe495 100644 (file)
@@ -2823,6 +2823,8 @@ int StrBufDecodeBase64(StrBuf *Buf)
        free(Buf->buf);
        Buf->buf = xferbuf;
        Buf->BufUsed = siz;
+
+       Buf->buf[Buf->BufUsed] = '\0';
        return siz;
 }