~ubuntu-branches/ubuntu/breezy/koffice/breezy-security

« back to all changes in this revision

Viewing changes to krita/modules/colorspace_ws/ws/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-10-11 14:49:50 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051011144950-lwpngbifzp8nk0ds
Tags: 1:1.4.1-0ubuntu7
* SECURITY UPDATE: fix heap based buffer overflow in the RTF importer of KWord
* Opening specially crafted RTF files in KWord can cause
  execution of abitrary code.
* Add kubuntu_01_rtfimport_heap_overflow.diff
* References:
  CAN-2005-2971
  CESA-2005-005
  http://www.koffice.org/security/advisory-20051011-1.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
        FILE:           main.c
 
3
        PURPOSE:        The top-level program for Wet&Sticky
 
4
        AUTHOR:         Kevin Waite and David England
 
5
        VERSION:        1.00  (10-May-91)
 
6
 
 
7
Copyright 1991, 1992, 2002, 2003 Tunde Cockshott, Kevin Waite, David England. 
 
8
 
 
9
Contact David England d.england@livjm.ac.uk
 
10
School of Computing and Maths Sciences,
 
11
Liverpool John Moores University 
 
12
Liverpool L3 3AF
 
13
United Kingdom
 
14
Phone +44 151 231 2271
 
15
 
 
16
 
 
17
Wet and Sticky is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Wet and Sticky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Wet and Sticky; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
 
18
 
 
19
*/
 
20
 
 
21
#include "constants.h"
 
22
#include "types.h"
 
23
#include "canvas.h"
 
24
#include "win_interface.h"
 
25
#include <stdio.h>
 
26
#include <string.h>
 
27
#include <math.h>
 
28
 
 
29
double HEIGHT_SCALE;
 
30
 
 
31
void main(argc, argv) 
 
32
int argc;
 
33
char *argv[];
 
34
 
 
35
/*
 
36
   The Wet&Sticky program can be executed with optional parameters.
 
37
   Those parameters used by the X graphics system are stripped out.
 
38
   If no parameters are given then the program runs as a purely
 
39
   interactive system.  This requires input handling which is not
 
40
   yet implemented.  If the argument is the string '-blob' then the
 
41
   program uses a square blob as the starting image.  Otherwise the
 
42
   program assumes the argument is a filename containing a previously
 
43
   stored canvas.  This is then loaded into the canvas as a starting
 
44
   point.
 
45
*/
 
46
 
 
47
{
 
48
   char *filename;
 
49
   extern void exit();
 
50
   int width;
 
51
   int height;
 
52
   extern int optind, opterr;
 
53
   extern char *optarg;
 
54
   int c,i;
 
55
   int blob_flag;
 
56
 
 
57
 
 
58
   fprintf(stdout, "Wet&Sticky Version %s\n", VERSION);
 
59
   fprintf(stdout, "Implemented by K.Waite and D.England, 1991\n");
 
60
   fprintf(stdout, "Based on ideas by Tunde Cockshott\n\n");
 
61
 
 
62
 
 
63
   initialise_canvas();
 
64
   if (DEBUG) fprintf (stdout, "Finished initialising the canvas\n");
 
65
 
 
66
   CreateWindows (&argc, argv, CANVAS_WIDTH , CANVAS_HEIGHT);
 
67
 
 
68
   filename = argv[1];
 
69
 
 
70
   blob_flag = 1;
 
71
   HEIGHT_SCALE = 20.0;
 
72
 
 
73
  opterr = 0;
 
74
    fprintf(stderr, "HEIGHT %g\n", HEIGHT_SCALE);
 
75
 
 
76
  while ((c = getopt(argc, argv, "f:s:")) != EOF)
 
77
                    switch (c) {
 
78
                case 'f':
 
79
                        filename = optarg;
 
80
                        load_file(filename, &width, &height);
 
81
                        blob_flag = 0;
 
82
                        break;
 
83
                case 's':
 
84
                        fprintf(stderr, "HEIGHT string %s \n",optarg);
 
85
                        HEIGHT_SCALE = atof(optarg);
 
86
                        break;
 
87
                case '?':
 
88
                        break;
 
89
                }
 
90
 
 
91
   if (blob_flag)
 
92
        blob (DEFAULT_BLOB_SIZE);
 
93
 
 
94
    fprintf(stderr, "HEIGHT %g\n", HEIGHT_SCALE);
 
95
 
 
96
   StartVolumeWindow (CANVAS_WIDTH, CANVAS_HEIGHT);
 
97
   StartDrynessWindow (CANVAS_WIDTH, CANVAS_HEIGHT);
 
98
 
 
99
   if (DEBUG) fprintf (stdout, "Finished preparing X\n");
 
100
 
 
101
   if (DEBUG) fprintf (stdout, "Passing control to window manager\n");
 
102
   StartWindows();
 
103
   exit(0);
 
104
 
 
105
}