OSSL_PARAM example code bug fix.
authorPauli <paul.dale@oracle.com>
Tue, 11 Jun 2019 23:48:13 +0000 (09:48 +1000)
committerPauli <paul.dale@oracle.com>
Tue, 11 Jun 2019 23:50:11 +0000 (09:50 +1000)
Technically not a bug since the code worked but the array index shouldn't have
been constant after searching for the field.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9136)

doc/man3/OSSL_PARAM.pod

index 50089b4d50ed5cfc9e5c8a75c91b0b200fd951ac..fb8c6fdae32bb407f0bc190d8a07ddc52fd7cf73 100644 (file)
@@ -276,8 +276,8 @@ could fill in the parameters like this:
             *(char **)params[i].data = "foo value";
             *params[i].return_size = 10; /* size of "foo value" */
         } else if (strcmp(params[i].key, "bar") == 0) {
-            memcpy(params[1].data, "bar value", 10);
-            *params[1].return_size = 10; /* size of "bar value" */
+            memcpy(params[i].data, "bar value", 10);
+            *params[i].return_size = 10; /* size of "bar value" */
         }
         /* Ignore stuff we don't know */
     }