JH/08 When generating a selfsigned cert, use serial number 1 since zero is not
legitimate.
+JH/09 Bug 2274: Fix logging of cmdline args when starting in an unlinked cwd.
+ Previously this would segfault.
+
Exim version 4.91
-----------------
Don't attempt it if logging is disabled, or if listing variables or if
verifying/testing addresses or expansions. */
-if (((debug_selector & D_any) != 0 || LOGGING(arguments))
- && really_exim && !list_options && !checking)
+if ( (debug_selector & D_any || LOGGING(arguments))
+ && really_exim && !list_options && !checking)
{
int i;
uschar *p = big_buffer;
Ustrcpy(p, "cwd= (failed)");
- Ustrncpy(p + 4, initial_cwd, big_buffer_size-5);
+ if (!initial_cwd)
+ p += 13;
+ else
+ {
+ Ustrncpy(p + 4, initial_cwd, big_buffer_size-5);
+ p += 4 + Ustrlen(initial_cwd);
+ /* in case p is near the end and we don't provide enough space for
+ * string_format to be willing to write. */
+ *p = '\0';
+ }
while (*p) p++;
(void)string_format(p, big_buffer_size - (p - big_buffer), " %d args:", argc);