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.