Menu

#71 Eliminate PATH_MAX

None
closed-accepted
None
1
2017-07-04
2017-07-03
No

gputils currently assumes that PATH_MAX is defined and is the maximum length of a filename. However

1) Many systems (e.g. Mac OS X, Linux) define PATH_MAX to a lower value than the maximum length of a filename for historical reasons.On such systems using PATH_MAX results in buffer overflows.
2) The POSIX standard states that PATH_MAX should not be defined when there is no fixed limit. And Hurd behaves according to the standard. Onsuch systems using PATH_MAX makes gputils fail to compile.

I have written a patch to eliminate use of PATH_MAX in gputils. Since I am not familiar with PICs, I didn't do any testing. Please have a look at the patch, and check if there are no regressions.

Philipp

1 Attachments

Discussion

  • Molnár Károly

    Molnár Károly - 2017-07-03
    • assigned_to: Molnár Károly
     
  • Molnár Károly

    Molnár Károly - 2017-07-03

    Thanks for the patch. I applied it after a small repair: [r1310]

    Károly

     

    Related

    Commit: [r1310]


    Last edit: Molnár Károly 2017-07-03
  • Molnár Károly

    Molnár Károly - 2017-07-04
    • status: open --> closed-accepted
    • discussion: enabled --> disabled