hi
problem1:
below is a java file that i have and after applying a security check
on the return reference,
i have this security risk involved :"The method returns the reference
Object type directly."
the suggested solution was to "Return a copy of the reference Object."
Can any one help me to see what i can do to remove this secutiry risk?
public class InventoryList{
public static InventoryList merge(InventoryList a, InventoryList b){
if (a == null){
return b;}
else if (b == null){
return a;
}
else {
InventoryList c = new InventoryList();
c.count = a.count + b.count;
c.head = a.head;
c.tail = b.tail;
a.tail.next = b.head;
return c;
}
}
}
problem 2:
i've been told to do work on the security check for "buffers
overflow". the only example i was given is below
int data[] = new data[10];
data[10] = 100;
can anyone explain to me how this checking of buffers overflow works
and perhaps and example to how it can be solved?
will really appreciate any help i can get :)