Skip to content

Commit 12b52b2

Browse files
committed
osc/pt2pt: fix infinite frag allocation loop
Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
1 parent 4146ef9 commit 12b52b2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ompi/mca/osc/pt2pt/osc_pt2pt_frag.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
33
* Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
4-
* Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
4+
* Copyright (c) 2014-2017 Los Alamos National Security, LLC. All rights
55
* reserved.
66
* $COPYRIGHT$
77
*
@@ -172,6 +172,10 @@ static inline int ompi_osc_pt2pt_frag_alloc (ompi_osc_pt2pt_module_t *module, in
172172
{
173173
int ret;
174174

175+
if (request_len > mca_osc_pt2pt_component.buffer_size) {
176+
return OMPI_ERR_OUT_OF_RESOURCE;
177+
}
178+
175179
do {
176180
ret = _ompi_osc_pt2pt_frag_alloc (module, target, request_len , buffer, ptr, long_send, buffered);
177181
if (OPAL_LIKELY(OMPI_SUCCESS == ret || OMPI_ERR_OUT_OF_RESOURCE != ret)) {

0 commit comments

Comments
 (0)