alpine 3.9
obsolete weakness #542

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

cdparanoia/src/cdparanoia-III-10.2/cachetest.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.9 obsolete weakness.

   }else{
    reportC("\tDrive readahead past read cursor: %d sector(s)                \n",readahead);
  }
  
   reportC("\tTesting cache tail cursor...");

  while(1){
    rollbehind=cachesize;
    
    for(i=0;i<10 && rollbehind;){
      int sofar=0,ret=0,retry=0;
      logC("\n\t\t>>> ");
      printC(".");
      while(sofar<cachesize){
	ret = cdda_read_timed(d,NULL,offset+sofar,cachesize-sofar,&x);
	if(ret<=0)goto error;
	logC("%d:%d:%d ",offset+sofar,ret,x);
	sofar+=ret;
      }
    
      /* Pause what we'd predict is needed to let the readahead process work. */
      {
	int usec=mspersector*readahead*1500;
	logC("\n\t\tsleeping %d microseconds",usec);
	usleep(usec);
      }
      
      /* read backwards until we seek */
      logC("\n\t\t<<< ");
      sofar=rollbehind;
      while(sofar>0){
	sofar--;
	ret = cdda_read_timed(d,NULL,offset+sofar,1,&x);
	if(ret<=0)break;
	logC("%d:%d:%d ",sofar,ret,x);
	if(x>=MIN_SEEK_MS){
	  if(rollbehind != sofar+1){
	    rollbehind=sofar+1;
	    i=0;
	  }else{
	    i++;
	  }
	  break;
	}
	if(sofar==0)rollbehind=0;
      }

    error:
      if(ret<=0){
	offset+=cachesize; 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.