Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sup/source Fix handling of pushback operation which...
details: https://anonhg.NetBSD.org/src/rev/45ffd9e0acb2
branches: trunk
changeset: 448473:45ffd9e0acb2
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Mon Feb 04 01:07:34 2019 +0000
description:
Fix handling of pushback operation which isn't using negative lengths
for about 10 years.
Found by gcc7.
diffstat:
usr.sbin/sup/source/scmio.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (23 lines):
diff -r 484f57467a59 -r 45ffd9e0acb2 usr.sbin/sup/source/scmio.c
--- a/usr.sbin/sup/source/scmio.c Mon Feb 04 00:55:26 2019 +0000
+++ b/usr.sbin/sup/source/scmio.c Mon Feb 04 01:07:34 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scmio.c,v 1.22 2013/03/08 20:56:44 christos Exp $ */
+/* $NetBSD: scmio.c,v 1.23 2019/02/04 01:07:34 mlelstv Exp $ */
/*
* Copyright (c) 1992 Carnegie Mellon University
@@ -434,11 +434,11 @@
char *data = vdata;
if (push) {
- if (bufptr + count < buffer)
+ if (bufptr - count < buffer)
return (scmerr(-1, "No space in buffer %zu", count));
bufptr -= count;
bufcnt += count;
- memcpy(bufptr, data, -count);
+ memcpy(bufptr, data, count);
return (SCMOK);
}
if (count == 0 && data == NULL) {
Home |
Main Index |
Thread Index |
Old Index