mirror of https://github.com/ipxe/ipxe.git
Don't complain when callers provide too-short buffers for
PXENV_GET_CACHED_INFO. NTLDR does this.pull/1/head
parent
698b5bc887
commit
6b0e147e0d
|
@ -168,15 +168,14 @@ PXENV_EXIT_t pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO
|
||||||
get_cached_info->BufferLimit );
|
get_cached_info->BufferLimit );
|
||||||
} else {
|
} else {
|
||||||
/* Copy packet to client buffer */
|
/* Copy packet to client buffer */
|
||||||
if ( len < sizeof ( cached_info[idx] ) ) {
|
if ( len > sizeof ( cached_info[idx] ) )
|
||||||
DBG ( " buffer too short" );
|
len = sizeof ( cached_info[idx] );
|
||||||
goto err;
|
if ( len < sizeof ( cached_info[idx] ) )
|
||||||
}
|
DBG ( " buffer may be too short" );
|
||||||
buffer = real_to_user ( get_cached_info->Buffer.segment,
|
buffer = real_to_user ( get_cached_info->Buffer.segment,
|
||||||
get_cached_info->Buffer.offset );
|
get_cached_info->Buffer.offset );
|
||||||
copy_to_user ( buffer, 0, &cached_info[idx],
|
copy_to_user ( buffer, 0, &cached_info[idx], len );
|
||||||
sizeof ( cached_info[idx] ) );
|
get_cached_info->BufferSize = len;
|
||||||
get_cached_info->BufferSize = sizeof ( cached_info[idx] );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get_cached_info->Status = PXENV_STATUS_SUCCESS;
|
get_cached_info->Status = PXENV_STATUS_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue