centos 6
shell weakness #30

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.

  * Utility functions for handing SMPTE Time Codes, as described in
 * SMPTE Standard 12M-1999.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "gstsmptetimecode.h"

#define NTSC_FRAMES_PER_10_MINS (10*60*30 - 10*2 + 2)
#define NTSC_FRAMES_PER_HOUR (6*NTSC_FRAMES_PER_10_MINS)

/**
 * gst_smpte_time_code_from_frame_number:
 * @system: SMPTE Time Code system
 * @time_code: pointer to time code structure
 * @frame_number: integer frame number
 *
 * Converts a frame number to a time code.
 *
 * Returns: TRUE if the conversion was successful
 */
gboolean
gst_smpte_time_code_from_frame_number (GstSMPTETimeCodeSystem system,
    GstSMPTETimeCode * time_code, int frame_number)
{
  int ten_mins;
  int n;

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

  time_code->hours = 99;
  time_code->minutes = 99;
  time_code->seconds = 99;
  time_code->frames = 99;

  if (frame_number < 0)
    return FALSE;

  switch (system) {
    case GST_SMPTE_TIME_CODE_SYSTEM_30:
      if (frame_number >= 24 * NTSC_FRAMES_PER_HOUR)
        return FALSE;

      ten_mins = frame_number / NTSC_FRAMES_PER_10_MINS;
      frame_number -= ten_mins * NTSC_FRAMES_PER_10_MINS;

      time_code->hours = ten_mins / 6; 

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.