Subject: safestrdup

From: Lorenz Minder <[email-masked]>
Date: Fri, 9 Feb 2001 21:35:41 +0100

[ I'm reposting this since my previous mail apparently didn't find the way
to this list. ]

Hello,

Studying the source code of fvwm I noticed that all Memory allocation
calls, except the strdup ones, are made through safe*-wrappers. The
situation, where strdup() returns zero is handled virtually nowhere. I
consider this inconsistency to be somewhat problematic, because in an
OOM condition you can't tell whether an *alloc() or strdup() call will
fail first.

I therefore implemented a safestrdup() and replaced all strdup()-calls
by safestrdup() ones. The following patch (against snap-20010126) does
this.

It is quite large for what it does, but it's also obvious and should
therefore be safe.

Regards,
--Lorenz

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 9 Feb 2001 17:27:10 -0600

> by safestrdup() ones. The following patch (against snap-20010126) does

Every time I used strdup, I wanted to implement a safe version, but
somehow didn't do this. Thanks.

Regards,
Mikhael.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Lorenz Minder <[email-masked]>
Date: Sun, 11 Feb 2001 03:13:41 +0100

> somehow didn't do this. Thanks.

You're welcome.

Regards,
--Lorenz