archrelease: copy trunk to community-any
[ArchLinux/community.git] / freehdl / trunk / acl-NULL-check.patch
blobb28d55a768553ee2ca217e48b49983d6538fa0a2
1 --- freehdl-0.0.8.orig/kernel/sigacl_list.cc 2002-01-02 16:20:57.000000000 +0200
2 +++ freehdl-0.0.8/kernel/sigacl_list.cc 2020-03-30 00:16:36.155392220 +0300
3 @@ -4,6 +4,7 @@
4 sigacl_list::sigacl_list(int size) {
5 count = 0;
6 list = new _items[size];
7 + list_size = size;
11 @@ -18,8 +19,15 @@
13 void
14 sigacl_list::add(sig_info_base *s, acl *a) {
15 + if (count >= list_size)
16 + {
17 + std::cout << "WARNING: sigacl_list::add()" << "\n" << "list index greater than list length\n" ;
18 + return;
19 + }
21 list[count].signal = s;
22 - list[count].aclp = a->clone();
23 + if (a != NULL) list[count].aclp = a->clone();
24 + else list[count].aclp = NULL;
25 count++;
28 --- freehdl-0.0.8.orig/freehdl/kernel-sigacl-list.hh 2000-02-03 16:50:59.000000000 +0200
29 +++ freehdl-0.0.8/freehdl/kernel-sigacl-list.hh 2020-03-30 00:16:34.923370868 +0300
30 @@ -20,6 +20,9 @@
31 sigacl_list(int size);
32 ~sigacl_list();
33 void add(sig_info_base *s, acl *a = NULL);
35 +private:
36 + int list_size;
40 --- freehdl-0.0.8.orig/kernel/dump.cc 2006-07-19 22:35:05.000000000 +0300
41 +++ freehdl-0.0.8/kernel/dump.cc 2020-03-30 00:16:36.243393745 +0300
42 @@ -24,6 +24,7 @@
43 dump_buffer.clean();
44 dump_buffer << dumped_name;
46 + if (a != NULL)
47 if (!a->end())
48 for (int i = 0; i < a->get_size(); i++)
49 dump_buffer << "(" << a->get(i) << ")";
50 @@ -32,6 +33,7 @@
51 reader_pointer = s->reader_pointer;
52 type = s->type;
54 + if (a != NULL)
55 if (! a->end()) {
56 reader_pointer = s->type->element(s->reader_pointer, a);
57 type = s->type->get_info(s->reader_pointer, a);