-/* $OpenBSD: cdio.c,v 1.63 2008/06/30 23:35:39 av Exp $ */
+/* $OpenBSD: cdio.c,v 1.64 2008/07/23 21:33:32 av Exp $ */
/* Copyright (c) 1995 Serge V. Vakulenko
* All rights reserved.
{
struct cmdtab *c;
char *p;
- int len;
+ size_t len;
for (p=buf; isspace(*p); p++)
continue;
-/* $OpenBSD: mmc.c,v 1.22 2008/06/30 23:35:39 av Exp $ */
+/* $OpenBSD: mmc.c,v 1.23 2008/07/23 21:33:32 av Exp $ */
/*
* Copyright (c) 2006 Michael Coulter <mjc@openbsd.org>
get_media_capabilities(int *cap)
{
scsireq_t scr;
- char buf[4096];
+ u_char buf[4096];
int error;
u_int32_t i, dsz;
u_int16_t feature;
dsz += 4; /* total size of bufer for all features */
i = 8;
while (i <= dsz - 4) {
- if (dsz - i < 4 + buf[i + 3])
+ if (dsz - i < (u_int32_t)buf[i + 3] + 4)
break; /* partial feature descriptor */
feature = betoh16(*(u_int16_t *)(buf + i));