Fix processing of PERL_ENV_TABLES.
authorCraig A. Berry <craigberry@mac.com>
Sat, 7 Sep 2013 11:55:25 +0000 (06:55 -0500)
committerCraig A. Berry <craigberry@mac.com>
Sat, 7 Sep 2013 12:27:25 +0000 (07:27 -0500)
commit88e3936f9263b4a3622ca03a8c99eb54aeeb192b
tree078f9f353b030a98a2ff074709efb3b153c75281
parentb66f3475d343bb78e55b4ba343433044f5966b6b
Fix processing of PERL_ENV_TABLES.

In a35dcc95dd24524931e I "improved" string safety in vms/vms.c by
converting to my_strlcpy and my_strlcat, but mangled the length
argument to my_strlcat when adding the name of the logical name
table specified in PERL_ENV_TABLES. This caused the command string
to be truncated, so a command that, for example, should have been:

    $ Show Logical * /Table=LNM$JOB
    ...

actually became:

    $ Show Logical * /Table=
    %DCL-W-VALREQ, missing qualifier or keyword value - supply all required values

Plus it turns out the strings holding the names of the tables were
being stored in dynamic string descriptors and were not
NUL-terminated, but the strl* functions require NUL-terminated
arguments.  So change those to static string descriptors and
allocate the exact amount of storage needed including room for a
NUL.

This was a regression in 5.16.0, first reported a couple of days
ago by Mark Daniel on comp.os.vms:

Date: Fri, 06 Sep 2013 12:56:01 +0930
From: Mark Daniel <mark.daniel [AT] wasd.vsm.com.au>
Newsgroups: comp.os.vms
Message-ID: <52294b4a$0$2875$c3e8da3$76491128@news.astraweb.com>

TODO: Figure out how and where to test this.
vms/vms.c