Mitigate Baron SameEdit (CVE-2021-3156) vulnerability

sles 15.1
integer weakness #2


Weakness Breakdown


An integer overflow occurs when the answer to an arithmetic operation exceeds the maximum size of the integer type used to store it. The resulting value will appear to have wrapped around the maximum value and started again at the minimum value. This would look like a clock that represents 13:00 by pointing at 1:00. An attacker can use an integer overflow during a buffer length calculation, which results in the allocated buffer being too small to hold the data copied into it, thus causing a buffer overflow.

Warning code(s):

Unless checked, the resulting number can exceed the expected range.

File Name:



The highlighted line of code below is the trigger point of this particular Sles 15.1 integer weakness.

   atspi_dbus_server_setup_with_g_main(server, NULL);
  dbus_server_set_new_connection_function(server, new_connection_cb, NULL, NULL);

  spi_global_app_data->server = server;

  return 0;

 * Checks the status of the environment variables
 * At this moment it only checks NO_AT_BRIDGE
 * Returns TRUE if there isn't anything on the environment preventing
 * you to load the bridge, FALSE otherwise
static gboolean
check_envvar (void)
  const gchar *envvar;

  envvar = g_getenv ("NO_AT_BRIDGE");

  if (envvar && atoi (envvar) == 1)
    return FALSE;
    return TRUE;

spi_atk_activate ()
  DRoutePath *treepath;

  spi_atk_register_event_listeners ();
  if (!spi_global_cache)
      spi_global_cache    = g_object_new (SPI_CACHE_TYPE, NULL);
      treepath = droute_add_one (spi_global_app_data->droute,
                                 "/org/a11y/atspi/cache", spi_global_cache);

      if (!treepath)
          g_warning ("atk-bridge: Error in droute_add_one().  Already running?");
      spi_initialize_cache (treepath);
      if (spi_global_app_data->bus)
        droute_path_register (treepath, spi_global_app_data->bus); 

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.