Changeset: c83ccf4f4da7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c83ccf4f4da7
Modified Files:
        clients/mapilib/mapi.c
Branch: Apr2019
Log Message:

Future-proof protocol: barf when we see something unexpected.


diffs (27 lines):

diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -4171,13 +4171,20 @@ read_into_cache(MapiHdl hdl, int lookahe
                                        } else {
                                                off = strtoul(line, &line, 10);
                                        }
-                                       assert(*line == ' ');
-                                       line++; /* skip one space */
+                                       if (*line++ != ' ') {
+                                               mnstr_printf(mid->to, 
"!HY000!unrecognized command from server\n");
+                                               mnstr_flush(mid->to);
+                                               break;
+                                       }
                                        read_file(hdl, off, strdup(line), 
binary);
                                        break;
                                }
                                case 'w':
-                                       line++; /* skip one space */
+                                       if (*line++ != ' ') {
+                                               mnstr_printf(mid->to, 
"!HY000!unrecognized command from server\n");
+                                               mnstr_flush(mid->to);
+                                               break;
+                                       }
                                        write_file(hdl, strdup(line));
                                        break;
                                }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to