summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2021-07-26 13:43:47 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2021-07-26 16:58:40 +0200
commit047677bb4b8a9273222048cef44bbc389bece932 (patch)
treeea5bc7f7eb7a94f3c250a188d17f9e70e83cb3b5 /src
parent8190c6f6df72f9c1d27bd19ebcdab76a5436aaa9 (diff)
#1054 Fix og_legacy_partition code buffer size
The "code" member of the og_legacy_partition is used to hold the string of the partition type *name* for legacy parameter strings. Example: par=2*cpt=LINUX-SWAP*sfi=LINUX-SWAP*tam=10000000*ope=0 Problem: Buffer size is smaller than possible values for this member. Fix: Increase buffer size up to the max length defined in the DB for the corresponding column.
Diffstat (limited to 'src')
-rw-r--r--src/dbi.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dbi.h b/src/dbi.h
index 33b7afc..cffb458 100644
--- a/src/dbi.h
+++ b/src/dbi.h
@@ -27,6 +27,7 @@ void og_dbi_close(struct og_dbi *db);
#define OG_DB_ROOM_LOC_MAXLEN 255
#define OG_DB_SERIAL_NUMBER_MAXLEN 25
#define OG_DB_IMAGE_DESCRIPTION_MAXLEN 250
+#define OG_DB_PART_NAME_MAXLEN 250
#define OG_DB_IMAGE_NAME_MAXLEN 50
#define OG_DB_FILESYSTEM_MAXLEN 16
#define OG_DB_NETDRIVER_MAXLEN 30
@@ -63,7 +64,7 @@ struct og_image {
struct og_legacy_partition {
char partition[OG_DB_SMALLINT_MAXLEN + 1];
- char code[OG_DB_INT8_MAXLEN + 1];
+ char code[OG_DB_PART_NAME_MAXLEN + 1];
char size[OG_DB_INT_MAXLEN + 1];
char filesystem[OG_DB_FILESYSTEM_MAXLEN + 1];
char format[2]; /* Format is a boolean 0 or 1 => length is 2 */