source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Fix hardlink detection on platforms having padding in struct
@ 2015-03-13  0:20 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2015-03-13  0:20 UTC (permalink / raw)
  To: source

Log Message:
-----------
Fix hardlink detection on platforms having padding in struct inodev,
typically 64bit platforms.  This was basically broken since forever.
Not only is the padding used, but it was used uninitialized.  
Problem reported by jmc@.

Modified Files:
--------------
    mdocml:
        mandocdb.c

Revision Data
-------------
Index: mandocdb.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mandocdb.c,v
retrieving revision 1.185
retrieving revision 1.186
diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.185 -r1.186
--- mandocdb.c
+++ mandocdb.c
@@ -942,6 +942,7 @@ mlink_add(struct mlink *mlink, const str
 	assert(NULL == ohash_find(&mlinks, slot));
 	ohash_insert(&mlinks, slot, mlink);
 
+	memset(&inodev, 0, sizeof(inodev));  /* Clear padding. */
 	inodev.st_ino = st->st_ino;
 	inodev.st_dev = st->st_dev;
 	slot = ohash_lookup_memory(&mpages, (char *)&inodev,
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-13  0:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13  0:20 mdocml: Fix hardlink detection on platforms having padding in struct schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).