tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ssp, __strcpy_ck: just to be sure



tlaronde%polynum.com@localhost writes:

> But then I realized that I have not changed the offending line: the
> strcpy() call since there was no overflow problem: it was doing inplace
> rewrite, suppressing a prefix (doing basename(1) essentially).

Not sure what "inplace" means, but it sounds like it runs afoul of:

  If copying takes place between objects that overlap, the behavior is
  undefined.

and thus it is fair to alert on it.

See:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/strcpy.html

and there is similar language in our man page.

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index