IMAP memory issues with use of ConstStr
authorHarlow Solutions <citadel@harlowsolutions.com>
Thu, 20 Jul 2023 18:40:56 +0000 (14:40 -0400)
committerHarlow Solutions <citadel@harlowsolutions.com>
Thu, 20 Jul 2023 18:40:56 +0000 (14:40 -0400)
commitb66d51b7bac2004ac436c287bb25a4bfa5c5ea95
tree020cf1009552a11b535013c1894330c0a1359017
parenteaa5fd8ad0d576c8e34ec04083e5462119f85e35
IMAP memory issues with use of ConstStr

Had a coredump in IMAP Search parsing.  Not sure of root cause, but parameter string parsing
  of IMAP Search coredumped on ConstStr pointer content access.

When ConstStr are created, pointer is null and length is zero.  Some code accesses the pointer
  contents without checking length first.  Not sure how parameter parsing passed a zero length
parameter, but added length checks before accessing throughout IMAP code to be safe.

While adding checks, found a typo in checking string for end of string in imap_list().
  Was using address of character instead of looking for null termination.  Corrected.
citadel/server/modules/imap/imap_list.c
citadel/server/modules/imap/imap_misc.c
citadel/server/modules/imap/imap_search.c
citadel/server/modules/imap/serv_imap.c