$Log$
+ Revision 613.10 2003/12/23 03:53:49 ajc
+ * Expanded the size of all string fields in "struct CtdlIPCMessage" to
+ the standard SIZ length, in order to accomodate "weird" messages
+ without crashing. Also converted many strcpy()'s to safestrncpy()'s
+ while populating this data structure, to avoid overruns.
+
Revision 613.9 2003/12/22 16:49:36 error
* Add Preview for Mac OS X as an image viewer option in citadel.rc
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
if (!strncasecmp(aaa, "nhdr=yes", 8))
mret[0]->nhdr = 1;
else if (!strncasecmp(aaa, "from=", 5))
- strcpy(mret[0]->author, &aaa[5]);
+ safestrncpy(mret[0]->author, &aaa[5], SIZ);
else if (!strncasecmp(aaa, "type=", 5))
mret[0]->type = atoi(&aaa[5]);
else if (!strncasecmp(aaa, "msgn=", 5))
- strcpy(mret[0]->msgid, &aaa[5]);
+ safestrncpy(mret[0]->msgid, &aaa[5], SIZ);
else if (!strncasecmp(aaa, "subj=", 5))
- strcpy(mret[0]->subject, &aaa[5]);
+ safestrncpy(mret[0]->subject, &aaa[5], SIZ);
else if (!strncasecmp(aaa, "rfca=", 5))
- strcpy(mret[0]->email, &aaa[5]);
+ safestrncpy(mret[0]->email, &aaa[5], SIZ);
else if (!strncasecmp(aaa, "hnod=", 5))
- strcpy(mret[0]->hnod, &aaa[5]);
+ safestrncpy(mret[0]->hnod, &aaa[5], SIZ);
else if (!strncasecmp(aaa, "room=", 5))
- strcpy(mret[0]->room, &aaa[5]);
+ safestrncpy(mret[0]->room, &aaa[5], SIZ);
else if (!strncasecmp(aaa, "node=", 5))
- strcpy(mret[0]->node, &aaa[5]);
+ safestrncpy(mret[0]->node, &aaa[5], SIZ);
else if (!strncasecmp(aaa, "rcpt=", 5))
- strcpy(mret[0]->recipient, &aaa[5]);
+ safestrncpy(mret[0]->recipient, &aaa[5], SIZ);
else if (!strncasecmp(aaa, "time=", 5))
mret[0]->time = atol(&aaa[5]);
char zaps[SIZ]; /* Message ID that this supersedes */
char subject[SIZ]; /* Message subject */
char email[SIZ]; /* Email address of sender */
- char author[USERNAME_SIZE]; /* Sender of message */
- char recipient[USERNAME_SIZE]; /* Recipient of message */
- char room[ROOMNAMELEN]; /* Originating room */
- char node[16]; /* Short nodename of origin system */
- char hnod[21]; /* Humannode of origin system */
+ char author[SIZ]; /* Sender of message */
+ char recipient[SIZ]; /* Recipient of message */
+ char room[SIZ]; /* Originating room */
+ char node[SIZ]; /* Short nodename of origin system */
+ char hnod[SIZ]; /* Humannode of origin system */
struct parts *attachments; /* Available attachments */
char *text; /* Message text */
int type; /* Message type */