pkgsrc/net/pppd/patches/patch-ba
cube 3e86158156 Initial import of pppd, version 2.4.3, into the NetBSD Package Collection.
The PPP Daemon is the userland part of the Point-to-Point Protocol.  It works
in combination with a dedicated kernel network interface usually named ppp.
PPP is a very extensible protocol and pppd supports a large number of options,
including compression (through various algorithms), cryptography (Microsoft's
MPPE) and authentication (PAP, CHAP, Microsoft CHAP), provided the kernel has
the relevant back-ends in some cases.
2005-01-02 02:51:40 +00:00

30 lines
893 B
Text

$NetBSD: patch-ba,v 1.1.1.1 2005/01/02 02:51:43 cube Exp $
--- pppd/tdb.c.orig 2004-11-13 08:13:07.000000000 +0100
+++ pppd/tdb.c
@@ -193,6 +193,8 @@ void tdb_set_lock_alarm(sig_atomic_t *pa
palarm_fired = palarm;
}
+static int tdb_update_hash __P((TDB_CONTEXT *, TDB_DATA, u32, TDB_DATA));
+
/* a byte range locking function - return 0 on success
this functions locks/unlocks 1 byte at the specified offset.
@@ -800,9 +802,13 @@ static int tdb_expand(TDB_CONTEXT *tdb,
tdb->map_size += size;
- if (tdb->flags & TDB_INTERNAL)
- tdb->map_ptr = realloc(tdb->map_ptr, tdb->map_size);
- else {
+ if (tdb->flags & TDB_INTERNAL) {
+ void *n;
+ n = realloc(tdb->map_ptr, tdb->map_size);
+ if (!n)
+ goto fail;
+ tdb->map_ptr = n;
+ } else {
/*
* We must ensure the file is remapped before adding the space
* to ensure consistency with systems like OpenBSD where