4c4
< __FBSDID("$FreeBSD: head/sys/dev/ofw/openfirmio.c 128019 2004-04-07 20:46:16Z imp $");
---
> __FBSDID("$FreeBSD: head/sys/dev/ofw/openfirmio.c 129587 2004-05-22 16:43:42Z marius $");
77,79d76
< /* Maximum accepted name length. */
< #define OFW_NAME_MAX 8191
<
102c99
< if ((u_int)len > OFW_NAME_MAX)
---
> if ((u_int)len > OFIOCMAXNAME)
132d128
< #if 0
134d129
< #endif
189d183
< #if 0
190a185,191
> /*
> * Note: Text string values for at least the /options node
> * have to be null-terminated and the length paramter must
> * include this terminating null. However, like OF_getprop(),
> * OF_setprop() will return the the actual length of the text
> * string, i.e. omitting the terminating null.
> */
194a196,197
> if ((u_int)of->of_buflen > OFIOCMAXVALUE)
> return (ENAMETOOLONG);
198c201,206
< error = openfirm_getstr(of->of_buflen, of->of_buf, &value);
---
> value = malloc(of->of_buflen, M_TEMP, M_WAITOK);
> if (value == NULL) {
> error = ENOMEM;
> break;
> }
> error = copyin(of->of_buf, value, of->of_buflen);
202c210
< if (len != of->of_buflen)
---
> if (len < 0)
203a212
> of->of_buflen = len;
205d213
< #endif
< __FBSDID("$FreeBSD: head/sys/dev/ofw/openfirmio.c 128019 2004-04-07 20:46:16Z imp $");
---
> __FBSDID("$FreeBSD: head/sys/dev/ofw/openfirmio.c 129587 2004-05-22 16:43:42Z marius $");
77,79d76
< /* Maximum accepted name length. */
< #define OFW_NAME_MAX 8191
<
102c99
< if ((u_int)len > OFW_NAME_MAX)
---
> if ((u_int)len > OFIOCMAXNAME)
132d128
< #if 0
134d129
< #endif
189d183
< #if 0
190a185,191
> /*
> * Note: Text string values for at least the /options node
> * have to be null-terminated and the length paramter must
> * include this terminating null. However, like OF_getprop(),
> * OF_setprop() will return the the actual length of the text
> * string, i.e. omitting the terminating null.
> */
194a196,197
> if ((u_int)of->of_buflen > OFIOCMAXVALUE)
> return (ENAMETOOLONG);
198c201,206
< error = openfirm_getstr(of->of_buflen, of->of_buf, &value);
---
> value = malloc(of->of_buflen, M_TEMP, M_WAITOK);
> if (value == NULL) {
> error = ENOMEM;
> break;
> }
> error = copyin(of->of_buf, value, of->of_buflen);
202c210
< if (len != of->of_buflen)
---
> if (len < 0)
203a212
> of->of_buflen = len;
205d213
< #endif