The patch for the net/minidlna port replaces read_random_bytes in uuid.c. However, the while loop in the replaced function treats the size_t variable 'size' as signed, causing the while loop break condition to fail, which then causes a sigbus. Fix: In uuid.c, replace: read_random_bytes(unsigned char *buf, size_t size) { long r; srandomdev(); while (size > 0) { r = random(); memcpy(buf, &r, size > sizeof(r) ? sizeof(r) : size); buf += sizeof(r); size -= sizeof(r); } } with (note cast in while loop): read_random_bytes(unsigned char *buf, size_t size) { long r; srandomdev(); while ((ssize_t)size > 0) { r = random(); memcpy(buf, &r, size > sizeof(r) ? sizeof(r) : size); buf += sizeof(r); size -= sizeof(r); } } Or, fix the buf and size arithmetic within the while loop to prevent 'size' from going below zero. How-To-Repeat: Run minidlna port (possibly only happens on amd64 host).
mi 2011-12-22 19:12:41 UTC FreeBSD ports repository Modified files: net/minidlna Makefile net/minidlna/files BSDmakefile patch-aa Log: Cast a size_t variable to ssize_t to prevent negatives being interpreted as huge positives. Bump PORTREVISION. Explicitly turn off the "deprecated-declarations" warning, which allows to delete the NO_WERROR setting from BSDmakefile. PR: 162526 Submitted by: Wes Santee Revision Changes Path 1.5 +1 -0 ports/net/minidlna/Makefile 1.4 +1 -2 ports/net/minidlna/files/BSDmakefile 1.3 +1 -1 ports/net/minidlna/files/patch-aa _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed already committed.
Responsible Changed From-To: freebsd-ports-bugs->mi