centos 6
shell weakness #19

4

Weakness Breakdown


Definition:

A shell weakness occurs when a program enables an attacker to execute unexpected commands on the operating system.

Warning code(s):

This causes a new program to execute and is difficult to use safely.

File Name:

gst-plugins-good-0.10.23/ext/dv/gstsmptetimecode.c

Context:

The highlighted line of code below is the trigger point of this particular Centos 6 shell weakness.

 
/**
 * gst_smpte_time_get_frame_number:
 * @system: SMPTE Time Code system
 * @frame_number: pointer to frame number
 * @time_code: pointer to time code structure
 *
 * Converts the time code structure to a linear frame number.
 *
 * Returns: TRUE if the time code could be converted
 */
gboolean
gst_smpte_time_code_get_frame_number (GstSMPTETimeCodeSystem system,
    int *frame_number, GstSMPTETimeCode * time_code)
{
  int frame = 0;

  g_return_val_if_fail (GST_SMPTE_TIME_CODE_SYSTEM_IS_VALID (system), FALSE);
  g_return_val_if_fail (time_code != NULL, FALSE);

  if (!gst_smpte_time_code_is_valid (system, time_code)) {
    return FALSE;
  }

  switch (system) {
    case GST_SMPTE_TIME_CODE_SYSTEM_30:
      frame = time_code->hours * NTSC_FRAMES_PER_HOUR;
      frame += (time_code->minutes / 10) * NTSC_FRAMES_PER_10_MINS;
      frame += (time_code->minutes % 10) * (30 * 60 - 2);
      frame += time_code->seconds * 30;
      break;
    case GST_SMPTE_TIME_CODE_SYSTEM_25:
      time_code->frames =
          25 * ((time_code->hours * 60 + time_code->minutes) * 60 +
          time_code->seconds);
      break;
    case GST_SMPTE_TIME_CODE_SYSTEM_24:
      time_code->frames =
          24 * ((time_code->hours * 60 + time_code->minutes) * 60 +
          time_code->seconds);
      break;
  }
  frame += time_code->frames;

  if (frame_number) {
    *frame_number = frame;
  }

  return TRUE;
} 

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.