fedora 25
obsolete weakness #288

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:

avrdude-6.3/stk500v2.c

Context:

The highlighted line of code below is the trigger point of this particular Fedora 25 obsolete weakness.

   avr_set_addr(op, buf + 1, addr);
  avr_set_input(op, buf + 1, data);

  avrdude_message(MSG_NOTICE2, "%s: stk500isp_write_byte(): Sending write memory command: ",
	    progname);

  result = stk500v2_command(pgm, buf, 5, sizeof(buf));

  if (result < 0) {
    avrdude_message(MSG_INFO, "%s: stk500isp_write_byte(): "
                    "timeout/error communicating with programmer\n",
                    progname);
    return -1;
  }

  /*
   * Prevent verification readback to be too fast, see
   * https://savannah.nongnu.org/bugs/index.php?42267
   *
   * After all, this is just an ugly hack working around some
   * brokeness in the Atmel firmware starting with the AVRISPmkII (the
   * old JTAGICEmkII isn't affected).  Let's hope 10 ms of additional
   * delay are good enough for everyone.
   */
  usleep(10000);

  return 0;
}

static int stk500v2_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
                                unsigned int page_size,
                                unsigned int addr, unsigned int n_bytes)
{
  unsigned int block_size, last_addr, addrshift, use_ext_addr;
  unsigned int maxaddr = addr + n_bytes;
  unsigned char commandbuf[10];
  unsigned char buf[266];
  unsigned char cmds[4];
  int result;
  OPCODE * rop, * wop;

  DEBUG("STK500V2: stk500v2_paged_write(..,%s,%u,%u,%u)\n",
        m->desc, page_size, addr, n_bytes);

  if (page_size == 0) page_size = 256;
  addrshift = 0;
  use_ext_addr = 0;

  // determine which command is to be used
  if (strcmp(m->desc, "flash") == 0) { 

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.