Date: Wed, 3 Aug 2016 18:04:08 +0000 (UTC) From: Mariusz Zaborski <oshogbo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303727 - head/bin/uuidgen Message-ID: <201608031804.u73I48p9001400@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: oshogbo Date: Wed Aug 3 18:04:08 2016 New Revision: 303727 URL: https://svnweb.freebsd.org/changeset/base/303727 Log: uuid_to_string(3) is allocating memory and can fail on that. Check if any error accrued. Modified: head/bin/uuidgen/uuidgen.c Modified: head/bin/uuidgen/uuidgen.c ============================================================================== --- head/bin/uuidgen/uuidgen.c Wed Aug 3 18:03:14 2016 (r303726) +++ head/bin/uuidgen/uuidgen.c Wed Aug 3 18:04:08 2016 (r303727) @@ -47,7 +47,7 @@ main(int argc, char *argv[]) FILE *fp; uuid_t *store, *uuid; char *p; - int ch, count, i, iterate; + int ch, count, i, iterate, status; count = -1; /* no count yet */ fp = stdout; /* default output file */ @@ -101,7 +101,9 @@ main(int argc, char *argv[]) uuid = store; while (count--) { - uuid_to_string(uuid++, &p, NULL); + uuid_to_string(uuid++, &p, &status); + if (status != uuid_s_ok) + err(1, "cannot stringify a UUID"); fprintf(fp, "%s\n", p); free(p); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608031804.u73I48p9001400>