opensm/st.c: fix potential core dumps
PATCH 1/1 opensm/st.c: fix potential core dumps
If we're out of polynomials, new_size() will return -1 Deal with this in low-level calls.
Signed-off-by Yevgeny Kliteynik <[email protected]>
--- opensm/opensm/st.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
opensm/opensm/st.c +5 -0
@@ -194,6 +194,8 @@ size_t size;#endif size =new_size (size);/* round up to prime number */ +if (size <0 ) +return NULL ; tbl =alloc (st_table); tbl->type = type;
@@ -351,6 +353,9 @@ register st_table *table;unsigned int hash_val; new_num_bins =new_size (old_num_bins +1 ); +if (new_num_bins <0 ) +return ; + new_bins = (st_table_entry **)Calloc (new_num_bins,sizeof (st_table_entry *));
Signature · 6 lines
1.6.2.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 4C8657D1.40900-VPRAkNaXOzVS1MOuV/[email protected]
Sasha Khapyorsky
AppliedQuoted 4 lines · Yevgeny Kliteynik
If we're out of polynomials,
new_size()will return -1 Deal with this in low-level calls.Signed-off-by Yevgeny Kliteynik <[email protected]>
Applied. Thanks.
Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html