diff options
author | sjg <sjg@FreeBSD.org> | 2014-05-08 23:54:15 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2014-05-08 23:54:15 +0000 |
commit | ed3fc70bf5a8edaf648093b11acca450802244ef (patch) | |
tree | 8ce0ddd0e6f508bd20c77429c448969589170fae /lib/libc | |
parent | d4e443e0426fee44056ba3c1123455666d083aef (diff) | |
parent | a2e6be0add027bf3e713c0d56ba9715b83a01144 (diff) | |
download | FreeBSD-src-ed3fc70bf5a8edaf648093b11acca450802244ef.zip FreeBSD-src-ed3fc70bf5a8edaf648093b11acca450802244ef.tar.gz |
Merge from head
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/Makefile | 2 | ||||
-rw-r--r-- | lib/libc/arm/gen/fpsetmask_vfp.c | 2 | ||||
-rw-r--r-- | lib/libc/locale/utf8.c | 7 | ||||
-rw-r--r-- | lib/libc/regex/engine.c | 7 | ||||
-rw-r--r-- | lib/libc/regex/regcomp.c | 1 | ||||
-rw-r--r-- | lib/libc/rpc/clnt_vc.c | 14 | ||||
-rw-r--r-- | lib/libc/sys/msync.2 | 12 |
7 files changed, 23 insertions, 22 deletions
diff --git a/lib/libc/Makefile b/lib/libc/Makefile index 6f88dac..e9bc33b 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -3,7 +3,7 @@ SHLIBDIR?= /lib -.include <bsd.own.mk> +.include <src.opts.mk> LIBC_SRCTOP?= ${.CURDIR} diff --git a/lib/libc/arm/gen/fpsetmask_vfp.c b/lib/libc/arm/gen/fpsetmask_vfp.c index 061c033..170e06d 100644 --- a/lib/libc/arm/gen/fpsetmask_vfp.c +++ b/lib/libc/arm/gen/fpsetmask_vfp.c @@ -45,7 +45,7 @@ fpsetmask(fp_except_t mask) __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); mask = (mask & FP_X_MASK) << 8; new = (old & ~(FP_X_MASK << 8)) | mask; - __asm __volatile("vmsr fpscr, %0" : : "r"(old)); + __asm __volatile("vmsr fpscr, %0" : : "r"(new)); return ((old >> 8) & FP_X_MASK); } diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c index 40f0e17..cffa241 100644 --- a/lib/libc/locale/utf8.c +++ b/lib/libc/locale/utf8.c @@ -203,6 +203,13 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, errno = EILSEQ; return ((size_t)-1); } + if (wch >= 0xd800 && wch <= 0xdfff) { + /* + * Malformed input; invalid code points. + */ + errno = EILSEQ; + return ((size_t)-1); + } if (pwc != NULL) *pwc = wch; us->want = 0; diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c index 2a1a75e..589bb9d 100644 --- a/lib/libc/regex/engine.c +++ b/lib/libc/regex/engine.c @@ -686,19 +686,16 @@ backref(struct match *m, while (m->g->strip[ss] != SOP(O_BACK, i)) ss++; return(backref(m, sp+len, stop, ss+1, stopst, lev, rec)); - break; case OQUEST_: /* to null or not */ dp = backref(m, sp, stop, ss+1, stopst, lev, rec); if (dp != NULL) return(dp); /* not */ return(backref(m, sp, stop, ss+OPND(s)+1, stopst, lev, rec)); - break; case OPLUS_: assert(m->lastpos != NULL); assert(lev+1 <= m->g->nplus); m->lastpos[lev+1] = sp; return(backref(m, sp, stop, ss+1, stopst, lev+1, rec)); - break; case O_PLUS: if (sp == m->lastpos[lev]) /* last pass matched null */ return(backref(m, sp, stop, ss+1, stopst, lev-1, rec)); @@ -709,7 +706,6 @@ backref(struct match *m, return(backref(m, sp, stop, ss+1, stopst, lev-1, rec)); else return(dp); - break; case OCH_: /* find the right one, if any */ ssub = ss + 1; esub = ss + OPND(s) - 1; @@ -730,6 +726,7 @@ backref(struct match *m, else assert(OP(m->g->strip[esub]) == O_CH); } + /* NOTREACHED */ break; case OLPAREN: /* must undo assignment if rest fails */ i = OPND(s); @@ -741,7 +738,6 @@ backref(struct match *m, return(dp); m->pmatch[i].rm_so = offsave; return(NULL); - break; case ORPAREN: /* must undo assignment if rest fails */ i = OPND(s); assert(0 < i && i <= m->g->nsub); @@ -752,7 +748,6 @@ backref(struct match *m, return(dp); m->pmatch[i].rm_eo = offsave; return(NULL); - break; default: /* uh oh */ assert(nope); break; diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index f3a41e9..55f9c04 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -746,7 +746,6 @@ p_b_term(struct parse *p, cset *cs) case '-': SETERROR(REG_ERANGE); return; /* NOTE RETURN */ - break; default: c = '\0'; break; diff --git a/lib/libc/rpc/clnt_vc.c b/lib/libc/rpc/clnt_vc.c index 7cd93b3..117cfba 100644 --- a/lib/libc/rpc/clnt_vc.c +++ b/lib/libc/rpc/clnt_vc.c @@ -301,15 +301,13 @@ clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz) return (cl); err: - if (cl) { - if (ct) { - if (ct->ct_addr.len) - mem_free(ct->ct_addr.buf, ct->ct_addr.len); - mem_free(ct, sizeof (struct ct_data)); - } - if (cl) - mem_free(cl, sizeof (CLIENT)); + if (ct) { + if (ct->ct_addr.len) + mem_free(ct->ct_addr.buf, ct->ct_addr.len); + mem_free(ct, sizeof (struct ct_data)); } + if (cl) + mem_free(cl, sizeof (CLIENT)); return ((CLIENT *)NULL); } diff --git a/lib/libc/sys/msync.2 b/lib/libc/sys/msync.2 index 42d8005..a91faf2 100644 --- a/lib/libc/sys/msync.2 +++ b/lib/libc/sys/msync.2 @@ -87,11 +87,13 @@ The .Fa addr argument is not a multiple of the hardware page size. -.It Bq Er EINVAL -The +.It Bq Er ENOMEM +The addresses in the range starting at +.Fa addr +and continuing for .Fa len -argument -is too large or negative. +bytes are outside the range allowed for the address space of a +process or specify one or more pages that are not mapped. .It Bq Er EINVAL The .Fa flags @@ -99,7 +101,7 @@ argument was both MS_ASYNC and MS_INVALIDATE. Only one of these flags is allowed. .It Bq Er EIO - An error occurred while writing at least one of the pages in +An error occurred while writing at least one of the pages in the specified region. .El .Sh SEE ALSO |