#251 SysGetFileDateTime modifying parameter

3.2.0
closed
Mark Hessling
None
5
2012-08-14
2007-04-06
Anonymous
No

Calling SysGetFileDateTime with a filename parameter that includes a tilde and a slash causes the slash to be removed. Example:

f = "~someuser/somefile"
Rc = SysGetFileDateTime(f)

will change the value of f to "~someusersomefile"

Discussion

  • Mark Hessling
    Mark Hessling
    2007-04-08

    Logged In: YES
    user_id=86185
    Originator: NO

    This is not limited to this function. Any Rexxutil function that accepts a filename argument has this bug.
    The problem is in resolve_tilde(). When the passed argument contains a username; ie "~username/" the slash is replaced with a .\0' in the argument passed to resolve_tilde() to get the username. This pointer points to argv[0].strptr in the Rexxutil function, which obviously points to the value of the Rexx variable passed in.

     
  • Mark Hessling
    Mark Hessling
    2007-04-08

    Logged In: YES
    user_id=86185
    Originator: NO

    Fix is to take a copy of the username component of the passed filename argument rather than changing the passed parameter.

     


Anonymous


Cancel   Add attachments