I am getting unchecked loop condition vulnerability in checkmark report in java application. user input not being validated

30 Views Asked by At
@RequestMapping("/process/{userInput}") 
public Integer purgeMessage(@PathVariable string queueName) {
   if(StringUtils.isNotEmpty(queueName) && queueName.length <=10)
        Integer count = service.publishMessage(queueName);
    else
        throw new RuntimeException("not valid");
}

public Integer publishMessage(String queueName) {
    Integer preCount = 0;

    // return number of count in a queue
    preCount = jmsTemplate.browse(queueName);// not full code written
    Integer count = null != preCount ? preCount : 0;

    while (count > 0) {
        jmsTemplate.receive(queueName);
        count--;
    }

    Integer postCount = jmsTemplate.browse(queueName);// not full code written

    return postCount;
}

I tried validating input string and set maximum limit in while also but still I am facing this issue

0

There are 0 best solutions below