[Info-vax] Whither VMS?

glen herrmannsfeldt gah at ugcs.caltech.edu
Mon Oct 5 23:57:53 EDT 2009


JF Mezei <jfmezei.spamnot at vaxination.ca> wrote:
< Re: C and buffer overflows.
 
< Is there a language which keeps 2 values for each string: amount
< allocated and amount currently in use ?
 
< Without such 2 values, you can't have totally save "read" and "write"
< into that variable. When you write, you need to know how many bytes you
< can write, and when you read, you need to know how many bytes were
< written to it.

I believe that PL/I does it.  In the implementations that I know of,
as well as I remember, the allocated length is known in the procedure
and passed in a descriptor (dope vector) on calls.  The current
length is at the beginning of the string.  Note, for example, that
for an array (in most languages) all elements have the same 
allocated length but possibly different current length.   

-- glen



More information about the Info-vax mailing list