Bug 23272

Summary: ntop's webinterface doesn't work correcty.
Product: [Retired] Red Hat Powertools Reporter: Need Real Name <sa>
Component: ntopAssignee: Than Ngo <than>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-01-04 08:02:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2001-01-04 08:02:26 UTC
ntop's webinterface can't handle modify user requests among other things.
http.c:434 says something like this:
  if(questionMark == NULL)
    sortedColumn = 0;
  else {
    if((questionMark[0] == '?') && (strlen(questionMark) > 3)) {
      questionMark[0] = 0;
      questionMark = strchr(&questionMark[1], '=');
      sortedColumn = 1+abs(atoi(&questionMark[1]));

atoi() doens't like to be called with a (NULL+1) pointer.

I changed this to:
  if(questionMark == NULL)
    sortedColumn = 0;
  else {
    if((questionMark[0] == '?') && (strlen(questionMark) > 3)) {
      char *x;
      x = strchr(&questionMark[1], '=');
      if(x) {
        questionMark = x;
        questionMark[0] = '\0';
        sortedColumn = 1+abs(atoi(&questionMark[1]));
      }

and now everything legal works.

Comment 1 Ngo Than 2001-01-04 12:00:51 UTC
ntop-1.3.2-2 in rawhide is not effected from this bug.